public class TypeInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static TypeInfo |
TYPE_ARRAY
ARRAY type with maximum parameters.
|
static TypeInfo |
TYPE_BOOLEAN
BOOLEAN type with parameters.
|
static TypeInfo |
TYPE_BYTE
BYTE type with parameters.
|
static TypeInfo |
TYPE_BYTES
BYTES type with maximum parameters.
|
static TypeInfo |
TYPE_DATE
DATE type with parameters.
|
static TypeInfo |
TYPE_DECIMAL
DECIMAL type with maximum parameters.
|
static TypeInfo |
TYPE_DECIMAL_DEFAULT
DECIMAL type with default parameters.
|
static TypeInfo |
TYPE_DOUBLE
DOUBLE type with parameters.
|
static TypeInfo |
TYPE_ENUM_UNDEFINED
ENUM type with undefined parameters.
|
static TypeInfo |
TYPE_FLOAT
FLOAT type with parameters.
|
static TypeInfo |
TYPE_GEOMETRY
GEOMETRY type with default parameters.
|
static TypeInfo |
TYPE_INT
INT type with parameters.
|
static TypeInfo |
TYPE_INTERVAL_DAY
INTERVAL DAY type with maximum parameters.
|
static TypeInfo |
TYPE_INTERVAL_DAY_TO_SECOND
INTERVAL DAY TO SECOND type with maximum parameters.
|
static TypeInfo |
TYPE_INTERVAL_HOUR_TO_SECOND
INTERVAL HOUR TO SECOND type with maximum parameters.
|
static TypeInfo |
TYPE_JAVA_OBJECT
JAVA_OBJECT type with parameters.
|
static TypeInfo |
TYPE_JSON
JSON type.
|
static TypeInfo |
TYPE_LONG
LONG type with parameters.
|
static TypeInfo |
TYPE_NULL
NULL type with parameters.
|
static TypeInfo |
TYPE_RESULT_SET
RESULT_SET type with parameters.
|
static TypeInfo |
TYPE_ROW
ROW (row value) type with parameters.
|
static TypeInfo |
TYPE_SHORT
SHORT type with parameters.
|
static TypeInfo |
TYPE_STRING
STRING type with maximum parameters.
|
static TypeInfo |
TYPE_STRING_IGNORECASE
STRING_IGNORECASE type with maximum parameters.
|
static TypeInfo |
TYPE_TIME
TIME type with maximum parameters.
|
static TypeInfo |
TYPE_TIME_TZ
TIME WITH TIME ZONE type with maximum parameters.
|
static TypeInfo |
TYPE_TIMESTAMP
TIMESTAMP type with maximum parameters.
|
static TypeInfo |
TYPE_TIMESTAMP_TZ
TIMESTAMP WITH TIME ZONE type with maximum parameters.
|
static TypeInfo |
TYPE_UNKNOWN
UNKNOWN type with parameters.
|
static TypeInfo |
TYPE_UUID
UUID type with parameters.
|
| Constructor and Description |
|---|
TypeInfo(int valueType,
long precision,
int scale,
int displaySize,
ExtTypeInfo extTypeInfo)
Creates new instance of data type with parameters.
|
| Modifier and Type | Method and Description |
|---|---|
Value |
cast(Value value,
CastDataProvider provider,
boolean forComparison,
boolean convertPrecision,
java.lang.Object column)
Casts a specified value to this data type taking precision and scale into
account.
|
int |
getDisplaySize()
Returns the display size in characters.
|
ExtTypeInfo |
getExtTypeInfo()
Returns the extended type information, or null.
|
long |
getPrecision()
Returns the precision.
|
int |
getScale()
Returns the scale.
|
java.lang.StringBuilder |
getSQL(java.lang.StringBuilder builder)
Appends SQL representation of this object to the specified string
builder.
|
static TypeInfo |
getTypeInfo(int type)
Get the data type with parameters object for the given value type and
maximum parameters.
|
static TypeInfo |
getTypeInfo(int type,
long precision,
int scale,
ExtTypeInfo extTypeInfo)
Get the data type with parameters object for the given value type and the
specified parameters.
|
int |
getValueType()
Returns the value type.
|
java.lang.String |
toString() |
public static final TypeInfo TYPE_UNKNOWN
public static final TypeInfo TYPE_NULL
public static final TypeInfo TYPE_BOOLEAN
public static final TypeInfo TYPE_BYTE
public static final TypeInfo TYPE_SHORT
public static final TypeInfo TYPE_INT
public static final TypeInfo TYPE_LONG
public static final TypeInfo TYPE_DECIMAL
public static final TypeInfo TYPE_DECIMAL_DEFAULT
public static final TypeInfo TYPE_DOUBLE
public static final TypeInfo TYPE_FLOAT
public static final TypeInfo TYPE_TIME
public static final TypeInfo TYPE_DATE
public static final TypeInfo TYPE_TIMESTAMP
public static final TypeInfo TYPE_BYTES
public static final TypeInfo TYPE_STRING
public static final TypeInfo TYPE_STRING_IGNORECASE
public static final TypeInfo TYPE_ARRAY
public static final TypeInfo TYPE_RESULT_SET
public static final TypeInfo TYPE_JAVA_OBJECT
public static final TypeInfo TYPE_UUID
public static final TypeInfo TYPE_GEOMETRY
public static final TypeInfo TYPE_TIMESTAMP_TZ
public static final TypeInfo TYPE_ENUM_UNDEFINED
public static final TypeInfo TYPE_INTERVAL_DAY
public static final TypeInfo TYPE_INTERVAL_DAY_TO_SECOND
public static final TypeInfo TYPE_INTERVAL_HOUR_TO_SECOND
public static final TypeInfo TYPE_ROW
public static final TypeInfo TYPE_JSON
public static final TypeInfo TYPE_TIME_TZ
public TypeInfo(int valueType,
long precision,
int scale,
int displaySize,
ExtTypeInfo extTypeInfo)
valueType - the value typeprecision - the precisionscale - the scaledisplaySize - the display size in charactersextTypeInfo - the extended type information, or nullpublic static TypeInfo getTypeInfo(int type)
type - the value typepublic static TypeInfo getTypeInfo(int type, long precision, int scale, ExtTypeInfo extTypeInfo)
type - the value typeprecision - the precisionscale - the scaleextTypeInfo - the extended type information, or nullpublic int getValueType()
public long getPrecision()
public int getScale()
public int getDisplaySize()
public ExtTypeInfo getExtTypeInfo()
public Value cast(Value value, CastDataProvider provider, boolean forComparison, boolean convertPrecision, java.lang.Object column)
value - value to castprovider - the cast information providerforComparison - if true, perform cast for comparison operationconvertPrecision - if true, value is truncated to the precision of data
type when possible, if false an exception in thrown
for too large valuescolumn - column, or nullDbException - if value cannot be casted to this data typepublic java.lang.StringBuilder getSQL(java.lang.StringBuilder builder)
builder - string builderpublic java.lang.String toString()
toString in class java.lang.Object