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 java.lang.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 Modifier and Type Field Description static java.lang.String
CHILD_WRAPPED_TYPE
-
Constructor Summary
Constructors Constructor Description GraphQLNonNull(GraphQLType wrappedType)
-
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.java.util.List<GraphQLSchemaElement>
getChildren()
SchemaElementChildrenContainer
getChildrenWithTypeReferences()
GraphQLType
getOriginalWrappedType()
GraphQLType
getWrappedType()
int
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.boolean
isEqualTo(java.lang.Object o)
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))
java.lang.String
toString()
GraphQLSchemaElement
withNewChildren(SchemaElementChildrenContainer newChildren)
-
-
-
Field Detail
-
CHILD_WRAPPED_TYPE
public static final java.lang.String CHILD_WRAPPED_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphQLNonNull
public GraphQLNonNull(GraphQLType wrappedType)
-
-
Method Detail
-
nonNull
public 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))
- Parameters:
wrappedType
- the type to wrap as being non null- Returns:
- a GraphQLNonNull of that wrapped type
-
getWrappedType
public GraphQLType getWrappedType()
- Specified by:
getWrappedType
in interfaceGraphQLModifiedType
-
getOriginalWrappedType
public GraphQLType getOriginalWrappedType()
-
isEqualTo
public boolean isEqualTo(java.lang.Object o)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
- Specified by:
accept
in interfaceGraphQLSchemaElement
-
getChildren
public java.util.List<GraphQLSchemaElement> getChildren()
- Specified by:
getChildren
in interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
public SchemaElementChildrenContainer getChildrenWithTypeReferences()
- Specified by:
getChildrenWithTypeReferences
in interfaceGraphQLSchemaElement
-
withNewChildren
public GraphQLSchemaElement 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.
-
-