@PublicApi public class InlineFragment extends AbstractNode<InlineFragment> implements Selection<InlineFragment>, SelectionSetContainer<InlineFragment>
| Modifier and Type | Class and Description |
|---|---|
static class |
InlineFragment.Builder |
| Modifier | Constructor and Description |
|---|---|
|
InlineFragment(TypeName typeCondition)
alternative to using a Builder for convenience
|
protected |
InlineFragment(TypeName typeCondition,
java.util.List<Directive> directives,
SelectionSet selectionSet,
SourceLocation sourceLocation,
java.util.List<Comment> comments) |
|
InlineFragment(TypeName typeCondition,
SelectionSet selectionSet)
alternative to using a Builder for convenience
|
| Modifier and Type | Method and Description |
|---|---|
TraversalControl |
accept(TraverserContext<Node> context,
NodeVisitor visitor)
Double-dispatch entry point.
|
InlineFragment |
deepCopy() |
java.util.List<Node> |
getChildren() |
Directive |
getDirective(java.lang.String directiveName) |
java.util.List<Directive> |
getDirectives() |
java.util.Map<java.lang.String,Directive> |
getDirectivesByName() |
SelectionSet |
getSelectionSet() |
TypeName |
getTypeCondition() |
boolean |
isEqualTo(Node o)
Compares just the content and not the children.
|
static InlineFragment.Builder |
newInlineFragment() |
java.lang.String |
toString() |
InlineFragment |
transform(java.util.function.Consumer<InlineFragment.Builder> builderConsumer) |
deepCopy, deepCopy, getComments, getSourceLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComments, getSourceLocationprotected InlineFragment(TypeName typeCondition, java.util.List<Directive> directives, SelectionSet selectionSet, SourceLocation sourceLocation, java.util.List<Comment> comments)
public InlineFragment(TypeName typeCondition)
typeCondition - the type condition of the inline fragmentpublic InlineFragment(TypeName typeCondition, SelectionSet selectionSet)
typeCondition - the type condition of the inline fragmentselectionSet - of the inline fragmentpublic TypeName getTypeCondition()
public java.util.List<Directive> getDirectives()
public java.util.Map<java.lang.String,Directive> getDirectivesByName()
public Directive getDirective(java.lang.String directiveName)
public SelectionSet getSelectionSet()
getSelectionSet in interface SelectionSetContainer<InlineFragment>public java.util.List<Node> getChildren()
getChildren in interface Node<InlineFragment>public boolean isEqualTo(Node o)
NodeisEqualTo in interface Node<InlineFragment>o - the other node to compare topublic InlineFragment deepCopy()
deepCopy in interface Node<InlineFragment>public java.lang.String toString()
toString in class java.lang.Objectpublic TraversalControl accept(TraverserContext<Node> context, NodeVisitor visitor)
NodeinstanceOf check when decision based on the actual
type of Node is needed, which happens redundantly during traversing AST.
Additional advantage of this pattern is to decouple tree traversal mechanism
from the code that needs to be executed when traversal "visits" a particular Node
in the tree. This leads to a better code re-usability and maintainability.accept in interface Node<InlineFragment>context - TraverserContext bound to this Node objectvisitor - Visitor instance that performs actual processing on the Nodes(s)public static InlineFragment.Builder newInlineFragment()
public InlineFragment transform(java.util.function.Consumer<InlineFragment.Builder> builderConsumer)