public static class TestCustomDataTypesHandler.TestOnlyCustomDataTypesHandler extends java.lang.Object implements CustomDataTypesHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
COMPLEX_DATA_TYPE_ID
Type id for complex number
|
static java.lang.String |
COMPLEX_DATA_TYPE_NAME
Type name for complex number
|
static int |
COMPLEX_DATA_TYPE_ORDER
Order for complex number data type
|
DataType |
complexDataType
Cached DataType instance for complex number
|
| Constructor and Description |
|---|
TestOnlyCustomDataTypesHandler() |
| Modifier and Type | Method and Description |
|---|---|
Value |
convert(Value source,
int targetType)
Convert the provided source value into value of given target data type
Shall implement conversions to and from custom data types.
|
int |
getAddProofType(int type)
Get compatible type identifier that would not overflow
after many add operations.
|
DataType |
getDataTypeById(int type)
Get custom data type given its integer id
|
DataType |
getDataTypeByName(java.lang.String name)
Get custom data type given its name
|
java.lang.String |
getDataTypeClassName(int type)
Get custom data type class name given its integer id
|
int |
getDataTypeOrder(int type)
Get order for custom data type given its integer id
|
java.lang.Object |
getObject(Value value,
java.lang.Class<?> cls)
Converts
Value object
to the specified class. |
int |
getTypeIdFromClass(java.lang.Class<?> cls)
Get custom data type identifier given corresponding Java class
|
Value |
getValue(int type,
java.lang.Object data,
DataHandler dataHandler)
Get
Value object
corresponding to given data type identifier and data. |
boolean |
supportsAdd(int type)
Checks if type supports add operation
|
public static final java.lang.String COMPLEX_DATA_TYPE_NAME
public static final int COMPLEX_DATA_TYPE_ID
public static final int COMPLEX_DATA_TYPE_ORDER
public final DataType complexDataType
public DataType getDataTypeByName(java.lang.String name)
CustomDataTypesHandlergetDataTypeByName in interface CustomDataTypesHandlername - data type namepublic DataType getDataTypeById(int type)
CustomDataTypesHandlergetDataTypeById in interface CustomDataTypesHandlertype - identifier of a data typepublic java.lang.String getDataTypeClassName(int type)
CustomDataTypesHandlergetDataTypeClassName in interface CustomDataTypesHandlertype - identifier of a data typepublic int getTypeIdFromClass(java.lang.Class<?> cls)
CustomDataTypesHandlergetTypeIdFromClass in interface CustomDataTypesHandlercls - Java class objectpublic Value convert(Value source, int targetType)
CustomDataTypesHandlerconvert in interface CustomDataTypesHandlersource - source valuetargetType - identifier of target data typepublic int getDataTypeOrder(int type)
CustomDataTypesHandlergetDataTypeOrder in interface CustomDataTypesHandlertype - identifier of a data typepublic Value getValue(int type, java.lang.Object data, DataHandler dataHandler)
CustomDataTypesHandlerValue object
corresponding to given data type identifier and data.getValue in interface CustomDataTypesHandlertype - custom data type identifierdata - underlying data type valuedataHandler - data handler objectpublic java.lang.Object getObject(Value value, java.lang.Class<?> cls)
CustomDataTypesHandlerValue object
to the specified class.getObject in interface CustomDataTypesHandlervalue - the value to convertcls - the target classpublic boolean supportsAdd(int type)
CustomDataTypesHandlersupportsAdd in interface CustomDataTypesHandlertype - custom data type identifierpublic int getAddProofType(int type)
CustomDataTypesHandlergetAddProofType in interface CustomDataTypesHandlertype - identifier of a type