T - the value java typepublic abstract class ValueType<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
static ValueType<Boolean> |
BOOLEAN
.
|
static ValueType<Date> |
DATE
.
|
static ValueType<Double> |
DOUBLE
.
|
static ValueType<Integer> |
INTEGER
.
|
static ValueType<String> |
STRING
.
|
| Modifier and Type | Method and Description |
|---|---|
T |
cast(Object o)
Casts the object to the underlying java type.
|
static <T> ValueType<T> |
decode(T t)
Returns the corresponding value type for the specified object or null if no valid one can be found.
|
static <T> ValueType<T> |
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() |
public boolean isInstance(Object o)
o - the objectpublic T cast(Object o) throws ClassCastException
o - the object to castClassCastException - if the object cannot be castedpublic static <T> ValueType<T> decode(T t)
T - the java typet - the object to decode type forpublic static <T> ValueType<T> get(T t) throws NullPointerException, IllegalArgumentException
T - the java typet - the object to get the type forNullPointerException - if the argument is nullIllegalArgumentException - if the argument does not match a valid typeCopyright © 2025 JBoss by Red Hat. All Rights Reserved.