Package graphql.schema
Class GraphQLNonNull
java.lang.Object
graphql.schema.GraphQLNonNull
- All Implemented Interfaces:
GraphQLInputSchemaElement
,GraphQLInputType
,GraphQLModifiedType
,GraphQLOutputType
,GraphQLSchemaElement
,GraphQLType
@PublicApi
public class GraphQLNonNull
extends Object
implements GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLModifiedType
A modified type that indicates there the underlying wrapped type will not be null.
See https://graphql.org/learn/schema/#lists-and-non-null for more details on the concept
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept
(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) copy()
Each GraphQLSchemaElement should make a copy of itself when this is called.final boolean
No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.final int
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.boolean
static GraphQLNonNull
nonNull
(GraphQLType wrappedType) A factory method for creating non null types so that when used with static imports allows more readable code such as.type(nonNull(GraphQLString))
toString()
withNewChildren
(SchemaElementChildrenContainer newChildren)
-
Field Details
-
CHILD_WRAPPED_TYPE
- See Also:
-
-
Constructor Details
-
GraphQLNonNull
-
-
Method Details
-
nonNull
A factory method for creating non null types so that when used with static imports allows more readable code such as.type(nonNull(GraphQLString))
- Parameters:
wrappedType
- the type to wrap as being non null- Returns:
- a GraphQLNonNull of that wrapped type
-
getWrappedType
- Specified by:
getWrappedType
in interfaceGraphQLModifiedType
-
getOriginalWrappedType
-
isEqualTo
-
toString
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
accept
in interfaceGraphQLSchemaElement
-
getChildren
- Specified by:
getChildren
in interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
- Specified by:
getChildrenWithTypeReferences
in interfaceGraphQLSchemaElement
-
withNewChildren
- Specified by:
withNewChildren
in interfaceGraphQLSchemaElement
-
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
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 classObject
- 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 classObject
- Returns:
- a hash code value for this object.
-