Package net.pricefx.common.api.pa
Enum DataType
-
- All Implemented Interfaces:
Serializable
,Comparable<DataType>
public enum DataType extends Enum<DataType>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
deserialize(String sValue)
Object
format(Object value)
static DataType
get(Object dataType)
boolean
isAssignable(Object value)
static boolean
isBoolean(Object value)
static boolean
isDate(Object value)
static boolean
isDateTime(Object value)
static boolean
isLong(Object value)
static boolean
isNumber(Object value)
boolean
isNumeric()
boolean
isTime()
static String
numberToString(Number number, int numberOfDecimals)
Object
parse(Object value)
Object
parse(Object value, Locale locale)
String
serialize(Object value)
static DataType
toDataType(Class<?> clazz)
static DataType
toDataType(Object value, DataType preferred)
static Number
toNumber(String value, Locale locale)
static DataType
valueOf(String name)
Returns the enum constant of this type with the specified name.static DataType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRING
public static final DataType STRING
-
NUMBER
public static final DataType NUMBER
-
DATE
public static final DataType DATE
-
BOOLEAN
public static final DataType BOOLEAN
-
DATETIME
public static final DataType DATETIME
-
LOB
public static final DataType LOB
-
LONG
public static final DataType LONG
-
UNKNOWN
public static final DataType UNKNOWN
-
-
Method Detail
-
values
public static DataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataType c : DataType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isAssignable
public boolean isAssignable(Object value)
-
isNumeric
public boolean isNumeric()
-
isTime
public boolean isTime()
-
isBoolean
public static boolean isBoolean(Object value)
-
isDate
public static boolean isDate(Object value)
-
isDateTime
public static boolean isDateTime(Object value)
-
isNumber
public static boolean isNumber(Object value)
-
isLong
public static boolean isLong(Object value)
-
-