Package graphql.language
Class NodeParentTree<T extends Node>
- java.lang.Object
-
- graphql.language.NodeParentTree<T>
-
@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.
-
-
Constructor Summary
Constructors Constructor Description NodeParentTree(java.util.Deque<T> nodeStack)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetNode()Returns the node represented by this infojava.util.Optional<NodeParentTree<T>>getParentInfo()java.util.List<java.lang.String>getPath()java.util.List<T>toList()java.lang.StringtoString()
-
-
-
Constructor Detail
-
NodeParentTree
public NodeParentTree(java.util.Deque<T> nodeStack)
-
-
Method Detail
-
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:
toStringin classjava.lang.Object
-
-