ObjectDataType

A data type implementation for the most common data types, including serializable objects.

Methods
static int compareNotNull(byte[] data1, byte[] data2)
Compare the contents of two byte arrays.
static int compareNotNull(byte[] data1, byte[] data2)
Compare the contents of two byte arrays. If the content or length of the first array is smaller than the second array, -1 is returned. If the content or length of the second array is smaller than the first array, 1 is returned. If the contents and lengths are the same, 0 is returned.

This method interprets bytes as unsigned.

Parameters:
data1 - the first byte array (must not be null)
data2 - the second byte array (must not be null)
Returns:
the result of the comparison (-1, 1 or 0)
static Object deserialize(byte[] data)
De-serialize the byte array to an object.
static Object deserialize(byte[] data)
De-serialize the byte array to an object.
Parameters:
data - the byte array
Returns:
the object
static Integer getCommonClassId(Class clazz)
Get the class id, or null if not found.
static Integer getCommonClassId(Class clazz)
Get the class id, or null if not found.
Parameters:
clazz - the class
Returns:
the class id or null
static boolean isArray(Object obj)
Check whether this object is an array.
static boolean isArray(Object obj)
Check whether this object is an array.
Parameters:
obj - the object
Returns:
true if yes
static boolean isBigDecimal(Object obj)
Check whether this object is a BigDecimal.
static boolean isBigDecimal(Object obj)
Check whether this object is a BigDecimal.
Parameters:
obj - the object
Returns:
true if yes
static boolean isBigInteger(Object obj)
Check whether this object is a BigInteger.
static boolean isBigInteger(Object obj)
Check whether this object is a BigInteger.
Parameters:
obj - the object
Returns:
true if yes
static boolean isDate(Object obj)
Check whether this object is a date.
static boolean isDate(Object obj)
Check whether this object is a date.
Parameters:
obj - the object
Returns:
true if yes
static byte[] serialize(Object obj)
Serialize the object to a byte array.
static byte[] serialize(Object obj)
Serialize the object to a byte array.
Parameters:
obj - the object to serialize
Returns:
the byte array
int compare(Object a, Object b)
int compare(Object a, Object b)
int getMemory(Object obj)
int getMemory(Object obj)
void read(ByteBuffer buff, Object[] obj, int len, boolean key)
void read(ByteBuffer buff, Object[] obj, int len, boolean key)
Object read(ByteBuffer buff)
Object read(ByteBuffer buff)
ObjectDataType.AutoDetectDataType switchType(Object obj)
Switch the last remembered type to match the type of the given object.
ObjectDataType.AutoDetectDataType switchType(Object obj)
Switch the last remembered type to match the type of the given object.
Parameters:
obj - the object
Returns:
the auto-detected type used
void write(WriteBuffer buff, Object[] obj, int len, boolean key)
void write(WriteBuffer buff, Object[] obj, int len, boolean key)
void write(WriteBuffer buff, Object obj)
void write(WriteBuffer buff, Object obj)