com.netflix.astyanax.serializers
Class PrefixedSerializer<P,S>

java.lang.Object
  extended by com.netflix.astyanax.serializers.AbstractSerializer<S>
      extended by com.netflix.astyanax.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(java.nio.ByteBuffer bytes)
          Extract an object of type T from the bytes.
 java.util.List<S> fromBytesList(java.util.List<java.nio.ByteBuffer> list)
           
<V> java.util.Map<S,V>
fromBytesMap(java.util.Map<java.nio.ByteBuffer,V> map)
           
 java.nio.ByteBuffer toByteBuffer(S s)
          Extract bytes from the obj of type T
 
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesSet, fromString, getComparatorType, getNext, getString, toBytes, toBytesList, toBytesList, 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 java.nio.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(java.nio.ByteBuffer bytes)
                 throws com.netflix.astyanax.connectionpool.exceptions.SerializationException
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:
Throws:
com.netflix.astyanax.connectionpool.exceptions.SerializationException

fromBytesList

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

fromBytesMap

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