|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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(java.nio.ByteBuffer byteBuffer)
Extract an object of type T from the bytes. |
|
T |
fromBytes(byte[] bytes)
|
|
java.util.List<T> |
fromBytesList(java.util.List<java.nio.ByteBuffer> list)
|
|
|
fromBytesMap(java.util.Map<java.nio.ByteBuffer,V> map)
|
|
java.util.List<T> |
fromBytesSet(java.util.Set<java.nio.ByteBuffer> set)
|
|
java.nio.ByteBuffer |
fromString(java.lang.String string)
Create a ByteBuffer by first parsing the type out of a string |
|
ComparatorType |
getComparatorType()
|
|
java.nio.ByteBuffer |
getNext(java.nio.ByteBuffer byteBuffer)
Return the byte buffer for the next value in sorted order for the matching comparator type. |
|
java.lang.String |
getString(java.nio.ByteBuffer byteBuffer)
|
|
abstract java.nio.ByteBuffer |
toByteBuffer(T obj)
Extract bytes from the obj of type T |
|
byte[] |
toBytes(T obj)
|
|
java.util.List<java.nio.ByteBuffer> |
toBytesList(java.util.Collection<T> list)
|
|
java.util.List<java.nio.ByteBuffer> |
toBytesList(java.lang.Iterable<T> list)
|
|
java.util.List<java.nio.ByteBuffer> |
toBytesList(java.util.List<T> list)
|
|
|
toBytesMap(java.util.Map<T,V> map)
|
|
java.util.Set<java.nio.ByteBuffer> |
toBytesSet(java.util.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 java.nio.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(java.nio.ByteBuffer byteBuffer)
Serializer
fromByteBuffer
in interface Serializer<T>
public java.util.Set<java.nio.ByteBuffer> toBytesSet(java.util.List<T> list)
toBytesSet
in interface Serializer<T>
public java.util.List<T> fromBytesSet(java.util.Set<java.nio.ByteBuffer> set)
fromBytesSet
in interface Serializer<T>
public java.util.List<java.nio.ByteBuffer> toBytesList(java.util.List<T> list)
toBytesList
in interface Serializer<T>
public java.util.List<java.nio.ByteBuffer> toBytesList(java.util.Collection<T> list)
toBytesList
in interface Serializer<T>
public java.util.List<java.nio.ByteBuffer> toBytesList(java.lang.Iterable<T> list)
toBytesList
in interface Serializer<T>
public java.util.List<T> fromBytesList(java.util.List<java.nio.ByteBuffer> list)
fromBytesList
in interface Serializer<T>
public <V> java.util.Map<java.nio.ByteBuffer,V> toBytesMap(java.util.Map<T,V> map)
toBytesMap
in interface Serializer<T>
public <V> java.util.Map<T,V> fromBytesMap(java.util.Map<java.nio.ByteBuffer,V> map)
fromBytesMap
in interface Serializer<T>
public int computeInitialHashSize(int initialSize)
public ComparatorType getComparatorType()
getComparatorType
in interface Serializer<T>
public java.nio.ByteBuffer fromString(java.lang.String string)
Serializer
fromString
in interface Serializer<T>
public java.lang.String getString(java.nio.ByteBuffer byteBuffer)
getString
in interface Serializer<T>
public java.nio.ByteBuffer getNext(java.nio.ByteBuffer byteBuffer)
Serializer
getNext
in interface Serializer<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |