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 classGraphQLAppliedDirectiveArgument.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHILD_TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalControlaccept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)GraphQLSchemaElementcopy()Each GraphQLSchemaElement should make a copy of itself when this is called.booleanequals(java.lang.Object o)No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.@NotNull InputValueWithStategetArgumentValue()java.util.List<GraphQLSchemaElement>getChildren()SchemaElementChildrenContainergetChildrenWithTypeReferences()ArgumentgetDefinition()The ASTNodethis schema element is based on.@Nullable java.lang.StringgetDescription()This will always be null.java.lang.StringgetName()GraphQLInputTypegetType()<T> TgetValue()This will give out an internal java value based on the semantics captured in theInputValueWithStatefromgetArgumentValue()Note : You MUST only call this on aGraphQLAppliedDirectiveArgumentthat is part of a fully formed schema.inthashCode()No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.booleanhasSetValue()static GraphQLAppliedDirectiveArgument.BuildernewArgument()static GraphQLAppliedDirectiveArgument.BuildernewArgument(GraphQLAppliedDirectiveArgument existing)java.lang.StringtoString()GraphQLAppliedDirectiveArgumenttransform(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.GraphQLAppliedDirectiveArgumentwithNewChildren(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:
getNamein interfaceGraphQLNamedSchemaElement- Returns:
- the name of this element. This cant be null
-
getType
public GraphQLInputType getType()
-
hasSetValue
public boolean hasSetValue()
-
getArgumentValue
@NotNull public @NotNull 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 theInputValueWithStatefromgetArgumentValue()Note : You MUST only call this on aGraphQLAppliedDirectiveArgumentthat 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
@Nullable public @Nullable java.lang.String getDescription()
This will always be null. Applied arguments have no description- Specified by:
getDescriptionin interfaceGraphQLNamedSchemaElement- Returns:
- always null
-
getDefinition
public Argument getDefinition()
Description copied from interface:GraphQLNamedSchemaElementThe ASTNodethis 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:
getDefinitionin interfaceGraphQLNamedSchemaElement- Returns:
- Node which this element is based on. Can be null.
-
getChildren
public java.util.List<GraphQLSchemaElement> getChildren()
- Specified by:
getChildrenin interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
public SchemaElementChildrenContainer getChildrenWithTypeReferences()
- Specified by:
getChildrenWithTypeReferencesin interfaceGraphQLSchemaElement
-
withNewChildren
public GraphQLAppliedDirectiveArgument withNewChildren(SchemaElementChildrenContainer newChildren)
- Specified by:
withNewChildrenin interfaceGraphQLSchemaElement
-
copy
public GraphQLSchemaElement copy()
Description copied from interface:GraphQLSchemaElementEach 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:
copyin 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:
equalsin interfaceGraphQLSchemaElement- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
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:
hashCodein interfaceGraphQLSchemaElement- Overrides:
hashCodein 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:
acceptin interfaceGraphQLSchemaElement
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-