public abstract class

AbstractSerializer

extends Object
implements Serializer<T>
java.lang.Object
   ↳ com.netflix.astyanax.serializers.AbstractSerializer<T>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Public Constructors
AbstractSerializer()
Public Methods
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)
<V> Map<T, V> 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(List<T> list)
List<ByteBuffer> toBytesList(Iterable<T> list)
List<ByteBuffer> toBytesList(Collection<T> list)
<V> Map<ByteBuffer, V> toBytesMap(Map<T, V> map)
Set<ByteBuffer> toBytesSet(List<T> list)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.Serializer

Public Constructors

public AbstractSerializer ()

Public Methods

public int computeInitialHashSize (int initialSize)

public abstract T fromByteBuffer (ByteBuffer byteBuffer)

Extract an object of type T from the bytes.

public T fromBytes (byte[] bytes)

public List<T> fromBytesList (List<ByteBuffer> list)

public Map<T, V> fromBytesMap (Map<ByteBuffer, V> map)

public List<T> fromBytesSet (Set<ByteBuffer> set)

public ByteBuffer fromString (String string)

Create a ByteBuffer by first parsing the type out of a string

public ComparatorType getComparatorType ()

public ByteBuffer getNext (ByteBuffer byteBuffer)

Return the byte buffer for the next value in sorted order for the matching comparator type. This is used for paginating columns.

public String getString (ByteBuffer byteBuffer)

public abstract ByteBuffer toByteBuffer (T obj)

Extract bytes from the obj of type T

public byte[] toBytes (T obj)

public List<ByteBuffer> toBytesList (List<T> list)

public List<ByteBuffer> toBytesList (Iterable<T> list)

public List<ByteBuffer> toBytesList (Collection<T> list)

public Map<ByteBuffer, V> toBytesMap (Map<T, V> map)

public Set<ByteBuffer> toBytesSet (List<T> list)