Package graphql.schema.idl
Class TypeInfo
- java.lang.Object
-
- graphql.schema.idl.TypeInfo
-
public class TypeInfo extends java.lang.Object
This helper gives you access to the type info given a type definition
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends GraphQLType>
Tdecorate(GraphQLType objectType)
This will decorate a graphql type with the original hierarchy of non null and list'ness it originally contained in its definition typeboolean
equals(java.lang.Object o)
static java.lang.String
getAstDesc(Type type)
java.lang.String
getName()
Type
getRawType()
TypeName
getTypeName()
int
hashCode()
boolean
isList()
boolean
isNonNull()
boolean
isPlain()
TypeInfo
renameAs(java.lang.String newName)
This will rename the type with the specified new name but will preserve the wrapping that was presentjava.lang.String
toString()
static TypeInfo
typeInfo(Type type)
TypeInfo
unwrapOne()
Type
unwrapOneType()
-
-
-
Method Detail
-
getRawType
public Type getRawType()
-
getTypeName
public TypeName getTypeName()
-
getName
public java.lang.String getName()
-
isList
public boolean isList()
-
isNonNull
public boolean isNonNull()
-
isPlain
public boolean isPlain()
-
renameAs
public TypeInfo renameAs(java.lang.String newName)
This will rename the type with the specified new name but will preserve the wrapping that was present- Parameters:
newName
- the new name of the type- Returns:
- a new type info rebuilt with the new name
-
decorate
public <T extends GraphQLType> T decorate(GraphQLType objectType)
This will decorate a graphql type with the original hierarchy of non null and list'ness it originally contained in its definition type- Type Parameters:
T
- the type- Parameters:
objectType
- this should be a graphql type that was originally built from this raw type- Returns:
- the decorated type
-
getAstDesc
public static java.lang.String getAstDesc(Type type)
-
unwrapOne
public TypeInfo unwrapOne()
-
unwrapOneType
public Type unwrapOneType()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-