Class TypeUtil


  • public class TypeUtil
    extends java.lang.Object
    This class consists of static utility methods for operating on Type.
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeUtil

        public TypeUtil()
    • 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)
        Returns true if the provided type is a non null type, otherwise returns false.
        Parameters:
        type - the type to check
        Returns:
        true if the provided type is a non null type otherwise false
      • isList

        public static boolean isList​(Type type)
        Returns true if the provided type is a list type, otherwise returns false.
        Parameters:
        type - the type to check
        Returns:
        true if the provided type is a list typ, otherwise false
      • isWrapped

        public 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.
        Parameters:
        type - the type to check
        Returns:
        true if the given type is a non null or list type, otherwise false