Class NodeParentTree<T extends Node>


  • @PublicApi
    public class NodeParentTree<T extends Node>
    extends java.lang.Object
    This represents a hierarchy from a graphql language node upwards to its associated parent nodes. For example a Directive can be on a InputValueDefinition which can be on a Argument, which can be on a FieldDefinition which may be on an ObjectTypeDefinition.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T node  
      private NodeParentTree<T> parent  
      private com.google.common.collect.ImmutableList<java.lang.String> path  
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeParentTree​(java.util.Deque<T> nodeStack)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T getNode()
      Returns the node represented by this info
      java.util.Optional<NodeParentTree<T>> getParentInfo()  
      java.util.List<java.lang.String> getPath()  
      private com.google.common.collect.ImmutableList<java.lang.String> mkPath​(java.util.Deque<T> copy)  
      java.util.List<T> toList()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • node

        private final T extends Node node
      • path

        private final com.google.common.collect.ImmutableList<java.lang.String> path
    • Constructor Detail

      • NodeParentTree

        public NodeParentTree​(java.util.Deque<T> nodeStack)
    • Method Detail

      • mkPath

        private com.google.common.collect.ImmutableList<java.lang.String> mkPath​(java.util.Deque<T> copy)
      • getNode

        public T getNode()
        Returns the node represented by this info
        Returns:
        the node in play
      • getParentInfo

        public java.util.Optional<NodeParentTree<T>> getParentInfo()
        Returns:
        a node MAY have an optional parent
      • getPath

        public java.util.List<java.lang.String> getPath()
        Returns:
        a path of names for nodes thar are NamedNodes
      • toList

        public java.util.List<T> toList()
        Returns:
        the tree as a list of T
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object