|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.chromattic.common.ValueType<T>
T - the value java typepublic abstract class ValueType<T>
The enumeration of value type that are permitted for attributes state. The generic type is used to represent the relevant associated java type for the runtime values.
| Field Summary | |
|---|---|
static ValueType<Boolean> |
BOOLEAN
. |
static ValueType<Date> |
DATE
. |
static ValueType<Double> |
DOUBLE
. |
static ValueType<Integer> |
INTEGER
. |
static ValueType<String> |
STRING
. |
| Method Summary | ||
|---|---|---|
T |
cast(Object o)
Casts the object to the underlying java type. |
|
static
|
decode(T t)
Returns the corresponding value type for the specified object or null if no valid one can be found. |
|
static
|
forClass(Class<T> t)
Returns the corresponding value type for the specified java class. |
|
static
|
get(T t)
Returns the corresponding value type for the specified object. |
|
Class<T> |
getJavaType()
Returns the java type. |
|
boolean |
isInstance(Object o)
Returns true if the object matches the type. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ValueType<String> STRING
public static final ValueType<Integer> INTEGER
public static final ValueType<Boolean> BOOLEAN
public static final ValueType<Date> DATE
public static final ValueType<Double> DOUBLE
| Method Detail |
|---|
public Class<T> getJavaType()
public boolean isInstance(Object o)
o - the object
public T cast(Object o)
throws ClassCastException
o - the object to cast
ClassCastException - if the object cannot be castedpublic static <T> ValueType<T> decode(T t)
T - the java typet - the object to decode type for
public static <T> ValueType<T> get(T t)
throws NullPointerException,
IllegalArgumentException
T - the java typet - the object to get the type for
NullPointerException - if the argument is null
IllegalArgumentException - if the argument does not match a valid type
public static <T> ValueType<T> forClass(Class<T> t)
throws NullPointerException,
IllegalArgumentException
T - the java typet - the java type
NullPointerException - if the argument is null
IllegalArgumentException - if the argument does not match a valid typepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||