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 booleanNo GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.final inthashCode()No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.booleanstatic GraphQLNonNullnonNull(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:
getWrappedTypein interfaceGraphQLModifiedType
-
getOriginalWrappedType
-
isEqualTo
-
toString
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
acceptin interfaceGraphQLSchemaElement
-
getChildren
- Specified by:
getChildrenin interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
- Specified by:
getChildrenWithTypeReferencesin interfaceGraphQLSchemaElement
-
withNewChildren
- Specified by:
withNewChildrenin interfaceGraphQLSchemaElement
-
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
No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.- Specified by:
equalsin interfaceGraphQLSchemaElement- Overrides:
equalsin classObject- 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 classObject- Returns:
- a hash code value for this object.
-