|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.astyanax.serializers.AbstractSerializer<T>
T
- public abstract class AbstractSerializer<T>
A base class for serializer implementations. Takes care of the default implementations of to/fromBytesList and to/fromBytesMap. Extenders of this class only need to implement the toBytes and fromBytes.
Constructor Summary | |
---|---|
AbstractSerializer()
|
Method Summary | ||
---|---|---|
int |
computeInitialHashSize(int initialSize)
|
|
abstract T |
fromByteBuffer(ByteBuffer byteBuffer)
Extract an object of type T from the bytes. |
|
T |
fromBytes(byte[] bytes)
|
|
List<T> |
fromBytesList(List<ByteBuffer> list)
|
|
|
fromBytesMap(Map<ByteBuffer,V> map)
|
|
List<T> |
fromBytesSet(Set<ByteBuffer> set)
|
|
ByteBuffer |
fromString(String string)
Create a ByteBuffer by first parsing the type out of a string |
|
ComparatorType |
getComparatorType()
|
|
ByteBuffer |
getNext(ByteBuffer byteBuffer)
Return the byte buffer for the next value in sorted order for the matching comparator type. |
|
String |
getString(ByteBuffer byteBuffer)
|
|
abstract ByteBuffer |
toByteBuffer(T obj)
Extract bytes from the obj of type T |
|
byte[] |
toBytes(T obj)
|
|
List<ByteBuffer> |
toBytesList(Collection<T> list)
|
|
List<ByteBuffer> |
toBytesList(List<T> list)
|
|
|
toBytesMap(Map<T,V> map)
|
|
Set<ByteBuffer> |
toBytesSet(List<T> list)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSerializer()
Method Detail |
---|
public abstract ByteBuffer toByteBuffer(T obj)
Serializer
toByteBuffer
in interface Serializer<T>
public byte[] toBytes(T obj)
toBytes
in interface Serializer<T>
public T fromBytes(byte[] bytes)
fromBytes
in interface Serializer<T>
public abstract T fromByteBuffer(ByteBuffer byteBuffer)
Serializer
fromByteBuffer
in interface Serializer<T>
public Set<ByteBuffer> toBytesSet(List<T> list)
toBytesSet
in interface Serializer<T>
public List<T> fromBytesSet(Set<ByteBuffer> set)
fromBytesSet
in interface Serializer<T>
public List<ByteBuffer> toBytesList(List<T> list)
toBytesList
in interface Serializer<T>
public List<ByteBuffer> toBytesList(Collection<T> list)
toBytesList
in interface Serializer<T>
public List<T> fromBytesList(List<ByteBuffer> list)
fromBytesList
in interface Serializer<T>
public <V> Map<ByteBuffer,V> toBytesMap(Map<T,V> map)
toBytesMap
in interface Serializer<T>
public <V> Map<T,V> fromBytesMap(Map<ByteBuffer,V> map)
fromBytesMap
in interface Serializer<T>
public int computeInitialHashSize(int initialSize)
public ComparatorType getComparatorType()
getComparatorType
in interface Serializer<T>
public ByteBuffer fromString(String string)
Serializer
fromString
in interface Serializer<T>
public String getString(ByteBuffer byteBuffer)
getString
in interface Serializer<T>
public ByteBuffer getNext(ByteBuffer byteBuffer)
Serializer
getNext
in interface Serializer<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |