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(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[]
|
Comparator<T> |
getComparator() |
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 IOException
bufferHandler - The incoming bufferHandlerIOException - If the deserialization failedT deserialize(ByteBuffer buffer) throws IOException
buffer - The incoming ByteBufferIOException - If the deserialization failedT fromBytes(byte[] buffer) throws IOException
buffer - The incoming byte[]IOException - If the deserialization failedT fromBytes(byte[] buffer, int pos) throws IOException
buffer - The incoming byte[]IOException - If the deserialization failedint compare(T type1, T type2)
type1 - The first type to comparetype2 - The second type to compareComparator<T> getComparator()
Class<?> getType()
Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.