me.prettyprint.cassandra.serializers
Class PrefixedSerializer<P,S>

java.lang.Object
  extended by me.prettyprint.cassandra.serializers.AbstractSerializer<S>
      extended by me.prettyprint.cassandra.serializers.PrefixedSerializer<P,S>
All Implemented Interfaces:
Serializer<S>

public class PrefixedSerializer<P,S>
extends AbstractSerializer<S>


Constructor Summary
PrefixedSerializer(P prefix, Serializer<P> prefixSerializer, Serializer<S> suffixSerializer)
           
 
Method Summary
 S fromByteBuffer(ByteBuffer bytes)
          Extract an object of type T from the bytes.
 List<S> fromBytesList(List<ByteBuffer> list)
           
<V> Map<S,V>
fromBytesMap(Map<ByteBuffer,V> map)
           
 ByteBuffer toByteBuffer(S s)
          Extract bytes from the obj of type T
 
Methods inherited from class me.prettyprint.cassandra.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesSet, getComparatorType, toBytes, toBytesList, toBytesMap, toBytesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixedSerializer

public PrefixedSerializer(P prefix,
                          Serializer<P> prefixSerializer,
                          Serializer<S> suffixSerializer)
Method Detail

toByteBuffer

public ByteBuffer toByteBuffer(S s)
Description copied from interface: Serializer
Extract bytes from the obj of type T

Specified by:
toByteBuffer in interface Serializer<S>
Specified by:
toByteBuffer in class AbstractSerializer<S>
Returns:

fromByteBuffer

public S fromByteBuffer(ByteBuffer bytes)
Description copied from interface: Serializer
Extract an object of type T from the bytes.

Specified by:
fromByteBuffer in interface Serializer<S>
Specified by:
fromByteBuffer in class AbstractSerializer<S>
Returns:

fromBytesList

public List<S> fromBytesList(List<ByteBuffer> list)
Specified by:
fromBytesList in interface Serializer<S>
Overrides:
fromBytesList in class AbstractSerializer<S>

fromBytesMap

public <V> Map<S,V> fromBytesMap(Map<ByteBuffer,V> map)
Specified by:
fromBytesMap in interface Serializer<S>
Overrides:
fromBytesMap in class AbstractSerializer<S>


Copyright © 2011. All Rights Reserved.