T - The type for the element to serialize and comparepublic interface ElementSerializer<T>
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T type1,
T type2)
Returns the comparison of two types.
|
T |
deserialize(BufferHandler bufferHandler)
Deserialize an element from a BufferHandler
|
T |
deserialize(java.nio.ByteBuffer buffer)
Deserialize an element from a ByteBuffer
|
T |
fromBytes(byte[] buffer)
Deserialize an element from a byte[]
|
T |
fromBytes(byte[] buffer,
int pos)
Deserialize an element from a byte[]
|
java.util.Comparator<T> |
getComparator() |
java.lang.Class<?> |
getType() |
byte[] |
serialize(T key)
Produce the byte[] representation of the element
|
byte[] serialize(T key)
key - The element to serializeT deserialize(BufferHandler bufferHandler) throws java.io.IOException
bufferHandler - The incoming bufferHandlerjava.io.IOException - If the deserialization failedT deserialize(java.nio.ByteBuffer buffer) throws java.io.IOException
buffer - The incoming ByteBufferjava.io.IOException - If the deserialization failedT fromBytes(byte[] buffer) throws java.io.IOException
buffer - The incoming byte[]java.io.IOException - If the deserialization failedT fromBytes(byte[] buffer, int pos) throws java.io.IOException
buffer - The incoming byte[]java.io.IOException - If the deserialization failedint compare(T type1, T type2)
type1 - The first type to comparetype2 - The second type to comparejava.util.Comparator<T> getComparator()
java.lang.Class<?> getType()