Package graphql.schema.idl
Class TypeUtil
java.lang.Object
graphql.schema.idl.TypeUtil
This class consists of
static
utility methods for operating on Type
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returnstrue
if the provided type is a list type, otherwise returnsfalse
.static boolean
Returnstrue
if the provided type is a non null type, otherwise returnsfalse
.static boolean
Returnstrue
if the given type is a non null or list type, that is a wrapped type, otherwise returnsfalse
.static String
simplePrint
(Type type) This will return the type in graphql SDL format, eg [typeName!]!static TypeName
Unwraps all layers of the type or just returns the type again if it's not a wrapped typestatic Type
Unwraps one layer of the type or just returns the type again if it's not a wrapped type
-
Constructor Details
-
TypeUtil
public TypeUtil()
-
-
Method Details
-
simplePrint
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
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
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
Returnstrue
if the provided type is a non null type, otherwise returnsfalse
.- Parameters:
type
- the type to check- Returns:
true
if the provided type is a non null type otherwisefalse
-
isList
Returnstrue
if the provided type is a list type, otherwise returnsfalse
.- Parameters:
type
- the type to check- Returns:
true
if the provided type is a list typ, otherwisefalse
-
isWrapped
Returnstrue
if the given type is a non null or list type, that is a wrapped type, otherwise returnsfalse
.- Parameters:
type
- the type to check- Returns:
true
if the given type is a non null or list type, otherwisefalse
-