Package graphql.schema.idl
Class TypeUtil
- java.lang.Object
-
- graphql.schema.idl.TypeUtil
-
public class TypeUtil extends java.lang.ObjectThis class consists ofstaticutility methods for operating onType.
-
-
Constructor Summary
Constructors Constructor Description TypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisList(Type type)Returnstrueif the provided type is a list type, otherwise returnsfalse.static booleanisNonNull(Type type)Returnstrueif the provided type is a non null type, otherwise returnsfalse.static booleanisWrapped(Type type)Returnstrueif the given type is a non null or list type, that is a wrapped type, otherwise returnsfalse.static java.lang.StringsimplePrint(Type type)This will return the type in graphql SDL format, eg [typeName!]!static TypeNameunwrapAll(Type type)Unwraps all layers of the type or just returns the type again if it's not a wrapped typestatic TypeunwrapOne(Type type)Unwraps one layer of the type or just returns the type again if it's not a wrapped type
-
-
-
Method Detail
-
simplePrint
public static java.lang.String simplePrint(Type type)
This will return the type in graphql SDL format, eg [typeName!]!- Parameters:
type- the type in play- Returns:
- the type in graphql SDL format, eg [typeName!]!
-
unwrapAll
public static TypeName unwrapAll(Type type)
Unwraps all layers of the type or just returns the type again if it's not a wrapped type- Parameters:
type- the type to be unwrapped- Returns:
- the unwrapped type or the same type again if it's not wrapped
-
unwrapOne
public static Type unwrapOne(Type type)
Unwraps one layer of the type or just returns the type again if it's not a wrapped type- Parameters:
type- the type to be unwrapped- Returns:
- the unwrapped type or the same type again if it's not wrapped
-
isNonNull
public static boolean isNonNull(Type type)
Returnstrueif the provided type is a non null type, otherwise returnsfalse.- Parameters:
type- the type to check- Returns:
trueif the provided type is a non null type otherwisefalse
-
isList
public static boolean isList(Type type)
Returnstrueif the provided type is a list type, otherwise returnsfalse.- Parameters:
type- the type to check- Returns:
trueif the provided type is a list typ, otherwisefalse
-
isWrapped
public static boolean isWrapped(Type type)
Returnstrueif the given type is a non null or list type, that is a wrapped type, otherwise returnsfalse.- Parameters:
type- the type to check- Returns:
trueif the given type is a non null or list type, otherwisefalse
-
-