@PublicApi public class GraphQLEnumType extends java.lang.Object implements GraphQLNamedInputType, GraphQLNamedOutputType, GraphQLUnmodifiedType, GraphQLNullableType, GraphQLDirectiveContainer
This allows you to validate that any arguments of this type are one of the allowed values and communicate through the type system that a field will always be one of a finite set of values.
See http://graphql.org/learn/schema/#enumeration-types for more details
| Modifier and Type | Class and Description |
|---|---|
static class |
GraphQLEnumType.Builder |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHILD_DIRECTIVES |
static java.lang.String |
CHILD_VALUES |
| Constructor and Description |
|---|
GraphQLEnumType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLEnumValueDefinition> values)
Deprecated.
use the
newEnum() builder pattern instead, as this constructor will be made private in a future version. |
GraphQLEnumType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLEnumValueDefinition> values,
java.util.List<GraphQLDirective> directives,
EnumTypeDefinition definition)
Deprecated.
use the
newEnum() builder pattern instead, as this constructor will be made private in a future version. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDirective, getDirectivesByNamepublic static final java.lang.String CHILD_VALUES
public static final java.lang.String CHILD_DIRECTIVES
@Deprecated
public GraphQLEnumType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLEnumValueDefinition> values)
newEnum() builder pattern instead, as this constructor will be made private in a future version.name - the namedescription - the descriptionvalues - the values@Deprecated
public GraphQLEnumType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLEnumValueDefinition> values,
java.util.List<GraphQLDirective> directives,
EnumTypeDefinition definition)
newEnum() builder pattern instead, as this constructor will be made private in a future version.name - the namedescription - the descriptionvalues - the valuesdirectives - the directives on this type elementdefinition - the AST definitionpublic java.util.List<GraphQLEnumValueDefinition> getValues()
public GraphQLEnumValueDefinition getValue(java.lang.String name)
public java.lang.String getName()
getName in interface GraphQLNamedSchemaElementpublic java.lang.String getDescription()
getDescription in interface GraphQLNamedSchemaElementpublic Coercing getCoercing()
public EnumTypeDefinition getDefinition()
GraphQLNamedSchemaElementNode this 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 example GraphQLObjectType.getExtensionDefinitions()getDefinition in interface GraphQLNamedSchemaElementpublic java.util.List<EnumTypeExtensionDefinition> getExtensionDefinitions()
public java.util.List<GraphQLDirective> getDirectives()
getDirectives in interface GraphQLDirectiveContainerpublic GraphQLEnumType transform(java.util.function.Consumer<GraphQLEnumType.Builder> builderConsumer)
builderConsumer - the consumer code that will be given a builder to transformpublic TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
accept in interface GraphQLSchemaElementpublic java.util.List<GraphQLSchemaElement> getChildren()
getChildren in interface GraphQLSchemaElementpublic SchemaElementChildrenContainer getChildrenWithTypeReferences()
getChildrenWithTypeReferences in interface GraphQLSchemaElementpublic GraphQLEnumType withNewChildren(SchemaElementChildrenContainer newChildren)
withNewChildren in interface GraphQLSchemaElementpublic static GraphQLEnumType.Builder newEnum()
public static GraphQLEnumType.Builder newEnum(GraphQLEnumType existing)