|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type to which data extraction should work.public interface Serializer<T>
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
.
Method Summary | ||
---|---|---|
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> list)
|
|
ComparatorType |
getComparatorType()
|
|
ByteBuffer |
toByteBuffer(T obj)
Extract bytes from the obj of type T |
|
byte[] |
toBytes(T obj)
|
|
List<ByteBuffer> |
toBytesList(List<T> list)
|
|
|
toBytesMap(Map<T,V> map)
|
|
Set<ByteBuffer> |
toBytesSet(List<T> list)
|
Method Detail |
---|
ByteBuffer toByteBuffer(T obj)
obj
-
byte[] toBytes(T obj)
T fromBytes(byte[] bytes)
T fromByteBuffer(ByteBuffer byteBuffer)
bytes
-
Set<ByteBuffer> toBytesSet(List<T> list)
List<T> fromBytesSet(Set<ByteBuffer> list)
<V> Map<ByteBuffer,V> toBytesMap(Map<T,V> map)
<V> Map<T,V> fromBytesMap(Map<ByteBuffer,V> map)
List<ByteBuffer> toBytesList(List<T> list)
List<T> fromBytesList(List<ByteBuffer> list)
ComparatorType getComparatorType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |