Interface Node

    • Method Detail

      • map

        default <T> T map​(T parent,
                          BiFunction<Node.Feature,​T,​T> mapFeature,
                          BiFunction<Node.Rule,​T,​T> mapRule,
                          BiFunction<Node.Scenario,​T,​T> mapScenario,
                          BiFunction<Node.ScenarioOutline,​T,​T> mapScenarioOutline,
                          BiFunction<Node.Examples,​T,​T> mapExamples,
                          BiFunction<Node.Example,​T,​T> mapExample)
        Recursively maps a node into another tree-like structure.
        Type Parameters:
        T - the type of the target structure
        Parameters:
        parent - the parent node of the target structure
        mapFeature - a function that takes a feature and a parent node and returns a mapped feature
        mapRule - a function that takes a rule and a parent node and returns a mapped rule
        mapScenario - a function that takes a scenario and a parent node and returns a mapped scenario
        mapScenarioOutline - a function that takes a scenario outline and a parent node and returns a mapped scenario outline
        mapExamples - a function that takes an examples and a parent node and returns a mapped examples
        mapExample - a function that takes an example and a parent node and returns a mapped example
        Returns:
        the mapped version of this instance
      • findPathTo

        default Optional<List<Node>> findPathTo​(Predicate<Node> predicate)
        Finds a path down tree starting at this node to the first node that matches the predicate using depth first search.
        Parameters:
        predicate - to match the target node.
        Returns:
        a path to the first node or an empty optional if none was found.