Interface TraversalStep<StepType,​DataType>

    • Method Detail

      • get

        Optional<DataType> get​(StepType tree,
                               java.lang.String key)
        Return the data for the key from the provided tree object.
        Returns:
        data object if available, or null.
      • remove

        Optional<DataType> remove​(StepType tree,
                                  java.lang.String key)
        Remove and return the data for the key from the provided tree object.
        Returns:
        data object if available, or null.
      • overwriteSet

        Optional<DataType> overwriteSet​(StepType tree,
                                        java.lang.String key,
                                        DataType data)
        Insert the data into the tree, overwriting any data that is there.
        Returns:
        returns the data object if successful or null if it could not
      • getChild

        TraversalStep getChild()
        Returns:
        the child Traversal or null if this Traversal has no child
      • newContainer

        StepType newContainer()
        Create a new mutable Map or List, suitable for this PathElement to traverse.
        Returns:
        new List or Map, depending on the type of the Traversal
      • getStepType

        java.lang.Class<?> getStepType()
        Return the Class of the Generic T, so that it can be used in an "instanceof" style check.
        Returns:
        Class that matches Generic parameter T
      • traverse

        Optional<DataType> traverse​(StepType tree,
                                    TraversalStep.Operation op,
                                    java.util.Iterator<java.lang.String> keys,
                                    DataType data)
        The meat of the Traversal. Pull a key from the iterator, use it to make the traversal, and then call traverse on your child Traversal.
        Parameters:
        tree - tree of data to walk
        op - the Operation to perform is this is the last node of the Traversal
        keys - keys to use
        data - the data to place if the operation is SET
        Returns:
        if SET, null for fail or the "data" object for ok. if GET, PANTS