Package graphql.schema
Class GraphQLAppliedDirectiveArgument
- java.lang.Object
-
- graphql.schema.GraphQLAppliedDirectiveArgument
-
- All Implemented Interfaces:
GraphQLInputSchemaElement
,GraphQLNamedSchemaElement
,GraphQLSchemaElement
@PublicApi public class GraphQLAppliedDirectiveArgument extends java.lang.Object implements GraphQLNamedSchemaElement, GraphQLInputSchemaElement
This represents the argument values that can be placed on anGraphQLAppliedDirective
.You can think of them as 'instances' of
GraphQLArgument
, when applied to a directive on a schema element
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GraphQLAppliedDirectiveArgument.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHILD_TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.@NonNull InputValueWithState
getArgumentValue()
java.util.List<GraphQLSchemaElement>
getChildren()
SchemaElementChildrenContainer
getChildrenWithTypeReferences()
Argument
getDefinition()
The ASTNode
this schema element is based on.@Nullable java.lang.String
getDescription()
This will always be null.java.lang.String
getName()
GraphQLInputType
getType()
<T> T
getValue()
This will give out an internal java value based on the semantics captured in theInputValueWithState
fromgetArgumentValue()
Note : You MUST only call this on aGraphQLAppliedDirectiveArgument
that is part of a fully formed schema.int
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.boolean
hasSetValue()
static GraphQLAppliedDirectiveArgument.Builder
newArgument()
static GraphQLAppliedDirectiveArgument.Builder
newArgument(GraphQLAppliedDirectiveArgument existing)
java.lang.String
toString()
GraphQLAppliedDirectiveArgument
transform(java.util.function.Consumer<GraphQLAppliedDirectiveArgument.Builder> builderConsumer)
This helps you transform the current GraphQLArgument into another one by starting a builder with all the current values and allows you to transform it how you want.GraphQLAppliedDirectiveArgument
withNewChildren(SchemaElementChildrenContainer newChildren)
-
-
-
Field Detail
-
CHILD_TYPE
public static final java.lang.String CHILD_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceGraphQLNamedSchemaElement
- Returns:
- the name of this element. This cant be null
-
getType
public GraphQLInputType getType()
-
hasSetValue
public boolean hasSetValue()
-
getArgumentValue
public @NonNull InputValueWithState getArgumentValue()
- Returns:
- an input value with state for an applied directive argument
-
getValue
public <T> T getValue()
This will give out an internal java value based on the semantics captured in theInputValueWithState
fromgetArgumentValue()
Note : You MUST only call this on aGraphQLAppliedDirectiveArgument
that is part of a fully formed schema. We need all the types to be resolved in order for this work correctly. Note: This method will return null if the value is not set or explicitly set to null. If you want to know the difference when "not set" and "set to null" then you can't use this method. Rather you should usegetArgumentValue()
and use theInputValueWithState.isNotSet()
methods to decide how to handle those values.- Type Parameters:
T
- the type you want it cast as- Returns:
- a value of type T which is the java value of the argument
-
getDescription
public @Nullable java.lang.String getDescription()
This will always be null. Applied arguments have no description- Specified by:
getDescription
in interfaceGraphQLNamedSchemaElement
- Returns:
- always null
-
getDefinition
public Argument getDefinition()
Description copied from interface:GraphQLNamedSchemaElement
The ASTNode
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 exampleGraphQLObjectType.getExtensionDefinitions()
- Specified by:
getDefinition
in interfaceGraphQLNamedSchemaElement
- Returns:
- Node which this element is based on. Can be null.
-
getChildren
public java.util.List<GraphQLSchemaElement> getChildren()
- Specified by:
getChildren
in interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
public SchemaElementChildrenContainer getChildrenWithTypeReferences()
- Specified by:
getChildrenWithTypeReferences
in interfaceGraphQLSchemaElement
-
withNewChildren
public GraphQLAppliedDirectiveArgument withNewChildren(SchemaElementChildrenContainer newChildren)
- Specified by:
withNewChildren
in interfaceGraphQLSchemaElement
-
copy
public GraphQLSchemaElement copy()
Description copied from interface:GraphQLSchemaElement
Each GraphQLSchemaElement should make a copy of itself when this is called. The copy should be included its current contents as they currently exist into a new object.- Specified by:
copy
in interfaceGraphQLSchemaElement
- Returns:
- a copy of this element
-
equals
public final boolean equals(java.lang.Object o)
No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.- Specified by:
equals
in interfaceGraphQLSchemaElement
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public final int hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.- Specified by:
hashCode
in interfaceGraphQLSchemaElement
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code value for this object.
-
transform
public GraphQLAppliedDirectiveArgument transform(java.util.function.Consumer<GraphQLAppliedDirectiveArgument.Builder> builderConsumer)
This helps you transform the current GraphQLArgument into another one by starting a builder with all the current values and allows you to transform it how you want.- Parameters:
builderConsumer
- the consumer code that will be given a builder to transform- Returns:
- a new field based on calling build on that builder
-
newArgument
public static GraphQLAppliedDirectiveArgument.Builder newArgument()
-
newArgument
public static GraphQLAppliedDirectiveArgument.Builder newArgument(GraphQLAppliedDirectiveArgument existing)
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
- Specified by:
accept
in interfaceGraphQLSchemaElement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-