public class TypeUtil
extends java.lang.Object
static
utility methods for operating on Type
.Constructor and Description |
---|
TypeUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isList(Type type)
Returns
true if the provided type is a list type,
otherwise returns false . |
static boolean |
isNonNull(Type type)
Returns
true if the provided type is a non null type,
otherwise returns false . |
static boolean |
isWrapped(Type type)
Returns
true if the given type is a non null or list type,
that is a wrapped type, otherwise returns false . |
static java.lang.String |
simplePrint(Type type)
This will return the type in graphql SDL format, eg [typeName!]!
|
static TypeName |
unwrapAll(Type type)
Unwraps all layers of the type or just returns the type again if it's not a wrapped type
|
static Type |
unwrapOne(Type type)
Unwraps one layer of the type or just returns the type again if it's not a wrapped type
|
public static java.lang.String simplePrint(Type type)
type
- the type in playpublic static TypeName unwrapAll(Type type)
type
- the type to be unwrappedpublic static Type unwrapOne(Type type)
type
- the type to be unwrappedpublic static boolean isNonNull(Type type)
true
if the provided type is a non null type,
otherwise returns false
.type
- the type to checktrue
if the provided type is a non null type
otherwise false
public static boolean isList(Type type)
true
if the provided type is a list type,
otherwise returns false
.type
- the type to checktrue
if the provided type is a list typ,
otherwise false
public static boolean isWrapped(Type type)
true
if the given type is a non null or list type,
that is a wrapped type, otherwise returns false
.type
- the type to checktrue
if the given type is a non null or list type,
otherwise false