public interface

Serializer

com.netflix.astyanax.Serializer<T>
Known Indirect Subclasses

Class Overview

Serializes a type T from the given bytes, or vice a versa. In cassandra column names and column values (and starting with 0.7.0 row keys) are all byte[]. To allow type safe conversion in java and keep all conversion code in one place we define the Extractor interface. Implementors of the interface define type conversion according to their domains. A predefined set of common extractors can be found in the extractors package, for example StringSerializer.

Summary

Public Methods
abstract T fromByteBuffer(ByteBuffer byteBuffer)
Extract an object of type T from the bytes.
abstract T fromBytes(byte[] bytes)
abstract List<T> fromBytesList(List<ByteBuffer> list)
abstract <V> Map<T, V> fromBytesMap(Map<ByteBuffer, V> map)
abstract List<T> fromBytesSet(Set<ByteBuffer> list)
abstract ByteBuffer fromString(String string)
Create a ByteBuffer by first parsing the type out of a string
abstract ComparatorType getComparatorType()
abstract ByteBuffer getNext(ByteBuffer byteBuffer)
Return the byte buffer for the next value in sorted order for the matching comparator type.
abstract String getString(ByteBuffer byteBuffer)
abstract ByteBuffer toByteBuffer(T obj)
Extract bytes from the obj of type T
abstract byte[] toBytes(T obj)
abstract List<ByteBuffer> toBytesList(List<T> list)
abstract List<ByteBuffer> toBytesList(Iterable<T> list)
abstract List<ByteBuffer> toBytesList(Collection<T> list)
abstract <V> Map<ByteBuffer, V> toBytesMap(Map<T, V> map)
abstract Set<ByteBuffer> toBytesSet(List<T> list)

Public Methods

public abstract T fromByteBuffer (ByteBuffer byteBuffer)

Extract an object of type T from the bytes.

public abstract T fromBytes (byte[] bytes)

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

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

public abstract List<T> fromBytesSet (Set<ByteBuffer> list)

public abstract ByteBuffer fromString (String string)

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

public abstract ComparatorType getComparatorType ()

public abstract 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 abstract String getString (ByteBuffer byteBuffer)

public abstract ByteBuffer toByteBuffer (T obj)

Extract bytes from the obj of type T

public abstract byte[] toBytes (T obj)

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

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

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

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

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