|
|||||||||
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(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> list)
|
|
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)
|
|
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)
|
Method Detail |
---|
java.nio.ByteBuffer toByteBuffer(T obj)
obj
-
byte[] toBytes(T obj)
T fromBytes(byte[] bytes)
T fromByteBuffer(java.nio.ByteBuffer byteBuffer)
bytes
-
java.util.Set<java.nio.ByteBuffer> toBytesSet(java.util.List<T> list)
java.util.List<T> fromBytesSet(java.util.Set<java.nio.ByteBuffer> list)
<V> java.util.Map<java.nio.ByteBuffer,V> toBytesMap(java.util.Map<T,V> map)
<V> java.util.Map<T,V> fromBytesMap(java.util.Map<java.nio.ByteBuffer,V> map)
java.util.List<java.nio.ByteBuffer> toBytesList(java.util.List<T> list)
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<T> fromBytesList(java.util.List<java.nio.ByteBuffer> list)
ComparatorType getComparatorType()
java.nio.ByteBuffer getNext(java.nio.ByteBuffer byteBuffer)
byteBuffer
-
java.nio.ByteBuffer fromString(java.lang.String string)
string
-
java.lang.String getString(java.nio.ByteBuffer byteBuffer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |