Class Type


  • public class Type
    extends Object
    This class represents the type for value object. Its default implementation is for java classes.
    Since:
    June 2014
    • Field Detail

      • BYTE

        public static final Type BYTE
        This is the byte type.
      • SHORT

        public static final Type SHORT
        This is the short type.
      • INTEGER

        public static final Type INTEGER
        This is the integer type
      • LONG

        public static final Type LONG
        This is the long type.
      • DOUBLE

        public static final Type DOUBLE
        This is the double type.
      • FLOAT

        public static final Type FLOAT
        This is the float type.
      • BOOLEAN

        public static final Type BOOLEAN
        This is the boolean type.
      • CHARACTER

        public static final Type CHARACTER
        This is the character type.
      • STRING

        public static final Type STRING
        This is the string type.
      • XML

        public static final Type XML
        This is the XML type.
      • OBJECT

        public static final Type OBJECT
        This is the objec type (for nulls)
      • ANY_TYPE

        public static final Type ANY_TYPE
        This is the type for custome types.
    • Method Detail

      • createType

        public static final Type createType​(Class<?> typeClass)
        Creates the type for given class
        Parameters:
        typeClass - Class of the Object or Primitive for which type is being created
        Returns:
        the Type for given class
      • createType

        public static final Type createType​(String typeName)
        Creates the type for given type name
        Parameters:
        typeName - Name of the type. It can be class name or even any other string also. In case if given name does not match with any primitive or respective wrapper classes, it will be marked as Custom Type
        Returns:
        the type.
      • isArray

        public final boolean isArray()
        Checks whether the type represents an array or not.
        Returns:
        true if the type represents an array, false otherwise
      • getComponentType

        public final Type getComponentType()
        Gets the component type for this type.
        Returns:
        the component type of this type, valid for array type only.
      • isAssignableFrom

        public final boolean isAssignableFrom​(Type type)
        Parameters:
        type - Type to check for assignment
        Returns:
        true if this Type is assignable from specified Type
      • getTypeClass

        public final Class<?> getTypeClass()
        Gets the typeClass
        Returns:
        Returns the typeClass. It can be null for types which does not represents a specific class, like XML type
      • getTypeName

        public final String getTypeName()
        Gets the typeName
        Returns:
        Returns the typeName. It can never be null
      • equals

        public boolean equals​(Object arg)
        Performs the type equality.
        Overrides:
        equals in class Object
      • toDebugString

        public String toDebugString()