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.StringCHILD_WRAPPED_TYPEprivate GraphQLTypeoriginalWrappedTypeprivate GraphQLTypereplacedWrappedType
-
Constructor Summary
Constructors Constructor Description GraphQLNonNull(GraphQLType wrappedType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalControlaccept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)private voidassertNonNullWrapping(GraphQLType wrappedType)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.java.util.List<GraphQLSchemaElement>getChildren()SchemaElementChildrenContainergetChildrenWithTypeReferences()GraphQLTypegetOriginalWrappedType()GraphQLTypegetWrappedType()inthashCode()No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.booleanisEqualTo(java.lang.Object o)static 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))(package private) voidreplaceType(GraphQLType type)java.lang.StringtoString()GraphQLSchemaElementwithNewChildren(SchemaElementChildrenContainer newChildren)
-
-
-
Field Detail
-
originalWrappedType
private final GraphQLType originalWrappedType
-
replacedWrappedType
private GraphQLType replacedWrappedType
-
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
-
assertNonNullWrapping
private void assertNonNullWrapping(GraphQLType wrappedType)
-
getWrappedType
public GraphQLType getWrappedType()
- Specified by:
getWrappedTypein interfaceGraphQLModifiedType
-
getOriginalWrappedType
public GraphQLType getOriginalWrappedType()
-
replaceType
void replaceType(GraphQLType type)
-
isEqualTo
public boolean isEqualTo(java.lang.Object o)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
- Specified by:
acceptin interfaceGraphQLSchemaElement
-
getChildren
public java.util.List<GraphQLSchemaElement> getChildren()
- Specified by:
getChildrenin interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
public SchemaElementChildrenContainer getChildrenWithTypeReferences()
- Specified by:
getChildrenWithTypeReferencesin interfaceGraphQLSchemaElement
-
withNewChildren
public GraphQLSchemaElement 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.
-
-