Class Type
- java.lang.Object
-
- org.vedantatree.expressionoasis.types.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 Summary
Fields Modifier and Type Field Description static Type
ANY_TYPE
This is the type for custome types.static Type
BOOLEAN
This is the boolean type.static Type
BYTE
This is the byte type.static Type
CHARACTER
This is the character type.static Type
DOUBLE
This is the double type.static Type
FLOAT
This is the float type.static Type
INTEGER
This is the integer typestatic Type
LONG
This is the long type.static Type
OBJECT
This is the objec type (for nulls)static Type
SHORT
This is the short type.static Type
STRING
This is the string type.static Type
XML
This is the XML type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Type
createType(Class<?> typeClass)
Creates the type for given classstatic Type
createType(String typeName)
Creates the type for given type nameboolean
equals(Object arg)
Performs the type equality.Type
getComponentType()
Gets the component type for this type.Class<?>
getTypeClass()
Gets the typeClassString
getTypeName()
Gets the typeNameboolean
isArray()
Checks whether the type represents an array or not.boolean
isAssignableFrom(Type type)
static void
main(String[] args)
String
toDebugString()
String
toString()
-
-
-
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.
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
toDebugString
public String toDebugString()
-
-