@PublicApi public class GraphQLAppliedDirective extends java.lang.Object implements GraphQLNamedSchemaElement
A directive has a definition, that is what arguments it takes, and it can also be applied
to other schema elements. Originally graphql-java re-used the GraphQLDirective and GraphQLArgument
classes to do both purposes. This was a modelling mistake. New GraphQLAppliedDirective and GraphQLAppliedDirectiveArgument
classes have been introduced to better model when a directive is applied to a schema element,
as opposed to its schema definition itself.
See http://graphql.org/learn/queries/#directives for more details on the concept.
| Modifier and Type | Class and Description |
|---|---|
static class |
GraphQLAppliedDirective.Builder |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHILD_ARGUMENTS |
| Modifier and Type | Method and Description |
|---|---|
TraversalControl |
accept(TraverserContext<GraphQLSchemaElement> context,
GraphQLTypeVisitor visitor) |
GraphQLSchemaElement |
copy()
Each GraphQLSchemaElement should make a copy of itself when this is called.
|
boolean |
equals(java.lang.Object o)
No GraphQLSchemaElement implements `equals` because we need object identity
to treat a GraphQLSchema as an abstract graph.
|
GraphQLAppliedDirectiveArgument |
getArgument(java.lang.String name) |
java.util.List<GraphQLAppliedDirectiveArgument> |
getArguments() |
java.util.List<GraphQLSchemaElement> |
getChildren() |
SchemaElementChildrenContainer |
getChildrenWithTypeReferences() |
Directive |
getDefinition()
The AST
Node this schema element is based on. |
java.lang.String |
getDescription() |
java.lang.String |
getName() |
int |
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity
to treat a GraphQLSchema as an abstract graph.
|
static GraphQLAppliedDirective.Builder |
newDirective() |
static GraphQLAppliedDirective.Builder |
newDirective(GraphQLAppliedDirective existing) |
java.lang.String |
toString() |
GraphQLAppliedDirective |
transform(java.util.function.Consumer<GraphQLAppliedDirective.Builder> builderConsumer)
This helps you transform the current GraphQLDirective into another one by starting a builder with all
the current values and allows you to transform it how you want.
|
GraphQLAppliedDirective |
withNewChildren(SchemaElementChildrenContainer newChildren) |
public static final java.lang.String CHILD_ARGUMENTS
public java.lang.String getName()
getName in interface GraphQLNamedSchemaElementpublic java.lang.String getDescription()
getDescription in interface GraphQLNamedSchemaElementpublic java.util.List<GraphQLAppliedDirectiveArgument> getArguments()
public GraphQLAppliedDirectiveArgument getArgument(java.lang.String name)
public Directive getDefinition()
GraphQLNamedSchemaElementNode this schema element is based on. Is null if the GraphQLSchema
is not based on a SDL document.
Some elements also have additional extension Nodes. See for example GraphQLObjectType.getExtensionDefinitions()getDefinition in interface GraphQLNamedSchemaElementpublic java.lang.String toString()
toString in class java.lang.Objectpublic GraphQLAppliedDirective transform(java.util.function.Consumer<GraphQLAppliedDirective.Builder> builderConsumer)
builderConsumer - the consumer code that will be given a builder to transformpublic GraphQLSchemaElement copy()
GraphQLSchemaElementcopy in interface GraphQLSchemaElementpublic TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
accept in interface GraphQLSchemaElementpublic java.util.List<GraphQLSchemaElement> getChildren()
getChildren in interface GraphQLSchemaElementpublic SchemaElementChildrenContainer getChildrenWithTypeReferences()
getChildrenWithTypeReferences in interface GraphQLSchemaElementpublic GraphQLAppliedDirective withNewChildren(SchemaElementChildrenContainer newChildren)
withNewChildren in interface GraphQLSchemaElementpublic final boolean equals(java.lang.Object o)
equals in interface GraphQLSchemaElementequals in class java.lang.Objecto - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.public final int hashCode()
hashCode in interface GraphQLSchemaElementhashCode in class java.lang.Objectpublic static GraphQLAppliedDirective.Builder newDirective()
public static GraphQLAppliedDirective.Builder newDirective(GraphQLAppliedDirective existing)