public class GenericTypeHelper extends java.lang.Object implements ITypeHelper
ITypeHelper
wraps ITypeHelper
and delegates the
calls to it.Constructor and Description |
---|
GenericTypeHelper(TypeHelper delegate)
Creates a new
GenericTypeHelper . |
Modifier and Type | Method and Description |
---|---|
IType |
bigDecimal()
Retrieves the;@link IType} for;@link BigDecimal}.
|
IType |
bigInteger()
Retrieves the;@link IType} for;@link BigInteger}.
|
IType |
booleanType()
Retrieves the;@link IType} for;@link Boolean}.
|
IType |
byteType()
Retrieves the;@link IType} for;@link Byte}.
|
IType |
characterType()
Retrieves the;@link IType} for;@link Character}.
|
IType |
collectionType()
Retrieves the;@link IType} for;@link Collection}.
|
IType |
convertPrimitive(java.lang.Object type)
Converts the given;@link IType}, if it's representing a primitive type, into the class of the
same type.
|
IType |
dateType()
Retrieves the;@link IType} for;@link Date}.
|
IType |
doubleType()
Retrieves the;@link IType} for;@link Double}.
|
IType |
enumType()
Retrieves the;@link IType} for;@link Enum}.
|
IType |
floatType()
Retrieves the;@link IType} for;@link Float}.
|
IType |
getType(java.lang.Class<?> type)
Returns the;@link IType} of the given Java type.
|
IType |
getType(java.lang.String typeName)
Retrieves the external class for the given fully qualified class name.
|
IType |
integerType()
Retrieves the;@link IType} for;@link Integer}.
|
boolean |
isBooleanType(java.lang.Object type)
Determines whether the given;@link IType} is a;@link Boolean}.
|
boolean |
isCollectionType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Collection}.
|
boolean |
isDateType(java.lang.Object type)
Determines whether the given;@link IType} is a;@link Date},;@link Timestamp} or
;@link Calendar}.
|
boolean |
isEnumType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Enum}.
|
boolean |
isFloatingType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of a floating type, which is either
Float , Double , float or double. |
boolean |
isIntegralType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of a floating type, which is either
Integer , Long , int or float. |
boolean |
isMapType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Map}.
|
boolean |
isNumericType(java.lang.Object type)
Determines whether the given;@link IType} is an instance of;@link Numeric}.
|
boolean |
isObjectType(java.lang.Object type)
Determines whether the given;@link IType} is the external form of;@link Object}.
|
boolean |
isPrimitiveType(java.lang.Object type)
Determines whether the given;@link IType} represents a primitive type.
|
boolean |
isStringType(java.lang.Object type)
Determines whether the given;@link IType} represents the
String class. |
IType |
longType()
Retrieves the;@link IType} for;@link Long}.
|
IType |
longType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive long, into the
Long type. |
IType |
mapType()
Retrieves the;@link IType} for;@link Map}.
|
IType |
numberType()
Retrieves the;@link IType} for;@link Number}.
|
IType |
objectType()
Retrieves the;@link IType} for;@link Object}.
|
ITypeDeclaration |
objectTypeDeclaration()
Returns the;@link Object } for the;@link IType} representing the
Object
class. |
IType |
primitiveBoolean()
Retrieves the;@link IType} for the primitive boolean.
|
IType |
primitiveByte()
Retrieves the;@link IType} for the primitive byte.
|
IType |
primitiveChar()
Retrieves the;@link IType} for the primitive char.
|
IType |
primitiveDouble()
Retrieves the;@link IType} for the primitive double.
|
IType |
primitiveFloat()
Retrieves the;@link IType} for the primitive float.
|
IType |
primitiveInteger()
Retrieves the;@link IType} for the primitive int.
|
IType |
primitiveLong()
Retrieves the;@link IType} for the primitive long.
|
IType |
primitiveShort()
Retrieves the;@link IType} for the primitive short.
|
IType |
shortType()
Retrieves the;@link IType} for;@link Short}.
|
IType |
stringType()
Retrieves the;@link IType} for;@link String}.
|
IType |
timestampType()
Retrieves the;@link IType} for;@link Timestamp}.
|
IType |
toBooleanType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive boolean, into the
Boolean
type. |
IType |
toByteType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive byte, into the
Byte
type. |
IType |
toDoubleType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive double, into the
Double
type. |
IType |
toFloatType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive float, into the
Float
type. |
IType |
toIntegerType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive int, into the
Integer
type. |
IType |
toShortType(java.lang.Object type)
Converts the given;@link IType}, if it's the primitive short, into the
Short
type. |
IType |
unknownType()
Retrieves the;@link IType} that represents an unknown type.
|
ITypeDeclaration |
unknownTypeDeclaration()
Returns the;@link Object } for the;@link IType} representing an unknown type.
|
public GenericTypeHelper(TypeHelper delegate)
GenericTypeHelper
.delegate
- The TypeHelper
that is wrapped by this one and all the calls are
delegated to itpublic IType bigDecimal()
bigDecimal
in interface ITypeHelper
BigDecimal
classpublic IType bigInteger()
bigInteger
in interface ITypeHelper
BigInteger
classpublic IType booleanType()
booleanType
in interface ITypeHelper
Boolean
classpublic IType byteType()
byteType
in interface ITypeHelper
Byte
classpublic IType characterType()
characterType
in interface ITypeHelper
Character
classpublic IType collectionType()
collectionType
in interface ITypeHelper
Collection
classpublic IType convertPrimitive(java.lang.Object type)
convertPrimitive
in interface ITypeHelper
type
- Type to possibly convert from the primitive into the classpublic IType dateType()
dateType
in interface ITypeHelper
Date
classpublic IType doubleType()
doubleType
in interface ITypeHelper
Double
classpublic IType enumType()
enumType
in interface ITypeHelper
Enum
classpublic IType floatType()
floatType
in interface ITypeHelper
Float
classpublic IType getType(java.lang.Class<?> type)
getType
in interface ITypeHelper
type
- The Java type for which its external form will be returnedpublic IType getType(java.lang.String typeName)
getType
in interface ITypeHelper
typeName
- The fully qualified class name of the class to retrievepublic IType integerType()
integerType
in interface ITypeHelper
Integer
classpublic boolean isBooleanType(java.lang.Object type)
isBooleanType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is a;@link Boolean}; false
otherwisepublic boolean isCollectionType(java.lang.Object type)
isCollectionType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is an instance of;@link Collection};
false
otherwisepublic boolean isDateType(java.lang.Object type)
isDateType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is a;@link Date},;@link Timestamp} or
;@link Calendar}public boolean isEnumType(java.lang.Object type)
isEnumType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is an instance of;@link Enum};
false
otherwisepublic boolean isFloatingType(java.lang.Object type)
Float
, Double
, float or double.isFloatingType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is a floating type; false
otherwisepublic boolean isIntegralType(java.lang.Object type)
Integer
, Long
, int or float.isIntegralType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is a integral type; false
otherwisepublic boolean isMapType(java.lang.Object type)
isMapType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is an instance of;@link Map};
false
otherwisepublic boolean isNumericType(java.lang.Object type)
isNumericType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is an instance of;@link Numeric};
false
otherwisepublic boolean isObjectType(java.lang.Object type)
isObjectType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} is the external form of;@link Object}public boolean isPrimitiveType(java.lang.Object type)
isPrimitiveType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} represents a primitive; false
otherwisepublic boolean isStringType(java.lang.Object type)
String
class.isStringType
in interface ITypeHelper
type
- The type to check it's assignabilitytrue
if the given;@link IType} represents the String
class;
false
otherwisepublic IType longType()
longType
in interface ITypeHelper
Long
classpublic IType longType(java.lang.Object type)
Long
type.longType
in interface ITypeHelper
type
- The;@link IType} to possibly convertLong
public IType mapType()
mapType
in interface ITypeHelper
Map
classpublic IType numberType()
numberType
in interface ITypeHelper
Number
classpublic IType objectType()
objectType
in interface ITypeHelper
Object
classpublic ITypeDeclaration objectTypeDeclaration()
Object
class.objectTypeDeclaration
in interface ITypeHelper
Object
classpublic IType primitiveBoolean()
primitiveBoolean
in interface ITypeHelper
public IType primitiveByte()
primitiveByte
in interface ITypeHelper
public IType primitiveChar()
primitiveChar
in interface ITypeHelper
public IType primitiveDouble()
primitiveDouble
in interface ITypeHelper
public IType primitiveFloat()
primitiveFloat
in interface ITypeHelper
public IType primitiveInteger()
primitiveInteger
in interface ITypeHelper
public IType primitiveLong()
primitiveLong
in interface ITypeHelper
public IType primitiveShort()
primitiveShort
in interface ITypeHelper
public IType shortType()
shortType
in interface ITypeHelper
Short
classpublic IType stringType()
stringType
in interface ITypeHelper
String
classpublic IType timestampType()
timestampType
in interface ITypeHelper
Timestamp
classpublic IType toBooleanType(java.lang.Object type)
Boolean
type.toBooleanType
in interface ITypeHelper
type
- The;@link IType} to possibly convertBoolean
public IType toByteType(java.lang.Object type)
Byte
type.toByteType
in interface ITypeHelper
type
- The;@link IType} to possibly convertByte
public IType toDoubleType(java.lang.Object type)
Double
type.toDoubleType
in interface ITypeHelper
type
- The;@link IType} to possibly convertDouble
public IType toFloatType(java.lang.Object type)
Float
type.toFloatType
in interface ITypeHelper
type
- The;@link IType} to possibly convertFloat
public IType toIntegerType(java.lang.Object type)
Integer
type.toIntegerType
in interface ITypeHelper
type
- The;@link IType} to possibly convertInteger
public IType toShortType(java.lang.Object type)
Short
type.toShortType
in interface ITypeHelper
type
- The;@link IType} to possibly convertShort
public IType unknownType()
unknownType
in interface ITypeHelper
public ITypeDeclaration unknownTypeDeclaration()
unknownTypeDeclaration
in interface ITypeHelper