@PublicApi public class GraphQLDirective extends java.lang.Object implements GraphQLNamedSchemaElement
| Modifier and Type | Class and Description |
|---|---|
static class |
GraphQLDirective.Builder |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHILD_ARGUMENTS |
| Constructor and Description |
|---|
GraphQLDirective(java.lang.String name,
java.lang.String description,
java.util.EnumSet<Introspection.DirectiveLocation> locations,
java.util.List<GraphQLArgument> arguments)
Deprecated.
Use the Builder
|
| Modifier and Type | Method and Description |
|---|---|
TraversalControl |
accept(TraverserContext<GraphQLSchemaElement> context,
GraphQLTypeVisitor visitor) |
boolean |
equals(java.lang.Object o)
No GraphQLSchemaElement implements `equals` because we need object identity
to treat a GraphQLSchema as an abstract graph.
|
GraphQLArgument |
getArgument(java.lang.String name) |
java.util.List<GraphQLArgument> |
getArguments() |
java.util.List<GraphQLSchemaElement> |
getChildren() |
SchemaElementChildrenContainer |
getChildrenWithTypeReferences() |
DirectiveDefinition |
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 GraphQLDirective.Builder |
newDirective() |
static GraphQLDirective.Builder |
newDirective(GraphQLDirective existing) |
java.lang.String |
toString() |
GraphQLDirective |
transform(java.util.function.Consumer<GraphQLDirective.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.
|
java.util.EnumSet<Introspection.DirectiveLocation> |
validLocations() |
GraphQLDirective |
withNewChildren(SchemaElementChildrenContainer newChildren) |
public static final java.lang.String CHILD_ARGUMENTS
@Deprecated
public GraphQLDirective(java.lang.String name,
java.lang.String description,
java.util.EnumSet<Introspection.DirectiveLocation> locations,
java.util.List<GraphQLArgument> arguments)
public java.lang.String getName()
getName in interface GraphQLNamedSchemaElementpublic java.util.List<GraphQLArgument> getArguments()
public GraphQLArgument getArgument(java.lang.String name)
public java.util.EnumSet<Introspection.DirectiveLocation> validLocations()
public java.lang.String getDescription()
getDescription in interface GraphQLNamedSchemaElementpublic DirectiveDefinition 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 GraphQLDirective transform(java.util.function.Consumer<GraphQLDirective.Builder> builderConsumer)
builderConsumer - the consumer code that will be given a builder to transformpublic 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 GraphQLDirective withNewChildren(SchemaElementChildrenContainer newChildren)
withNewChildren in interface GraphQLSchemaElementpublic final boolean equals(java.lang.Object o)
equals in interface GraphQLSchemaElementequals in class java.lang.Objectpublic final int hashCode()
hashCode in interface GraphQLSchemaElementhashCode in class java.lang.Objectpublic static GraphQLDirective.Builder newDirective()
public static GraphQLDirective.Builder newDirective(GraphQLDirective existing)