public interface DataType
extends java.io.Serializable
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataType.ID
Data type ID.
|
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
BooleanPattern
Regex for boolean.
|
static java.util.regex.Pattern |
DatePattern
Regex for date.
|
static java.util.regex.Pattern |
DateTimePattern
Regex for datetime.
|
static java.util.regex.Pattern |
DoublePattern
Regex for double.
|
static java.util.regex.Pattern |
IntPattern
Regex for integer.
|
static java.util.regex.Pattern |
LongPattern
Regex for long.
|
static java.util.regex.Pattern |
TimePattern
Regex for time.
|
| Modifier and Type | Method and Description |
|---|---|
default DataType |
boxed()
Returns the boxed data type if this is a primitive type.
|
static DataType |
coerce(DataType a,
DataType b)
Returns the common type.
|
DataType.ID |
id()
Returns the type ID enum.
|
static DataType |
infer(java.lang.String s)
Infers the type of a string.
|
default boolean |
isBoolean()
Returns true if the type is boolean or Boolean.
|
default boolean |
isByte()
Returns true if the type is byte or Byte.
|
default boolean |
isChar()
Returns true if the type is char or Char.
|
default boolean |
isDouble()
Returns true if the type is double or Double.
|
static boolean |
isDouble(DataType t)
Returns true if the given type is of double,
either primitive or boxed.
|
default boolean |
isFloat()
Returns true if the type is float or Float.
|
static boolean |
isFloat(DataType t)
Returns true if the given type is of float,
either primitive or boxed.
|
default boolean |
isFloating()
Returns true if the type is float or double.
|
default boolean |
isInt()
Returns true if the type is int or Integer.
|
static boolean |
isInt(DataType t)
Returns true if the given type is of int, short, byte, char,
either primitive or boxed.
|
default boolean |
isIntegral()
Returns true if the type is int, long, short or byte.
|
default boolean |
isLong()
Returns true if the type is long or Long.
|
static boolean |
isLong(DataType t)
Returns true if the given type is of long,
either primitive or boxed.
|
default boolean |
isNumeric()
Returns true if the type is numeric (integral or floating).
|
default boolean |
isObject()
Returns true if the type is ObjectType.
|
default boolean |
isPrimitive()
Returns true if this is a primitive data type.
|
default boolean |
isShort()
Returns true if the type is short or Shorter.
|
default boolean |
isString()
Returns true if the type is String.
|
java.lang.String |
name()
Returns the type name used in external catalogs.
|
static DataType |
of(java.lang.Class clazz)
Returns the DataType of a class.
|
static DataType |
of(java.sql.JDBCType type,
boolean nullable,
java.lang.String dbms)
Returns the DataType of a JDBC type.
|
static DataType |
of(java.lang.String s)
Returns a DataType from its string representation.
|
static DataType |
prompt(DataType a,
DataType b)
Type promotion when apply to expressions.
|
default java.lang.String |
toString(java.lang.Object o)
Returns the string representation of a value of the type.
|
default DataType |
unboxed()
Returns the unboxed data type if this is a boxed primitive type.
|
java.lang.Object |
valueOf(java.lang.String s)
Returns the value from its string representation.
|
static final java.util.regex.Pattern BooleanPattern
static final java.util.regex.Pattern IntPattern
static final java.util.regex.Pattern LongPattern
static final java.util.regex.Pattern DoublePattern
static final java.util.regex.Pattern DatePattern
static final java.util.regex.Pattern TimePattern
static final java.util.regex.Pattern DateTimePattern
java.lang.String name()
DataType.ID id()
java.lang.Object valueOf(java.lang.String s)
s - the string representation of a value of this type.default java.lang.String toString(java.lang.Object o)
default boolean isPrimitive()
default boolean isFloating()
default boolean isIntegral()
default boolean isNumeric()
default boolean isBoolean()
default boolean isChar()
default boolean isByte()
default boolean isShort()
default boolean isInt()
default boolean isLong()
default boolean isFloat()
default boolean isDouble()
default boolean isString()
default boolean isObject()
default DataType boxed()
default DataType unboxed()
static DataType infer(java.lang.String s)
static DataType of(java.lang.String s) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionstatic DataType of(java.lang.Class clazz)
static DataType of(java.sql.JDBCType type, boolean nullable, java.lang.String dbms)
type - a JDBCTypenullable - true if the column value may be nulldbms - The database product name.static DataType prompt(DataType a, DataType b)
static DataType coerce(DataType a, DataType b)
static boolean isInt(DataType t)
static boolean isLong(DataType t)
static boolean isFloat(DataType t)
static boolean isDouble(DataType t)