com.netflix.astyanax.serializers
Class TypeInferringSerializer<T>

java.lang.Object
  extended by com.netflix.astyanax.serializers.AbstractSerializer<T>
      extended by com.netflix.astyanax.serializers.TypeInferringSerializer<T>
Type Parameters:
T - type
All Implemented Interfaces:
Serializer<T>

public class TypeInferringSerializer<T>
extends AbstractSerializer<T>
implements Serializer<T>

A serializer that dynamically delegates to a proper serializer based on the value passed


Constructor Summary
TypeInferringSerializer()
           
 
Method Summary
 T fromByteBuffer(java.nio.ByteBuffer byteBuffer)
          Extract an object of type T from the bytes.
static
<T> TypeInferringSerializer<T>
get()
           
 java.nio.ByteBuffer toByteBuffer(T obj)
          Extract bytes from the obj of type T
 
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, 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
 
Methods inherited from interface com.netflix.astyanax.Serializer
fromBytes, fromBytesList, fromBytesMap, fromBytesSet, fromString, getComparatorType, getNext, getString, toBytes, toBytesList, toBytesList, toBytesList, toBytesMap, toBytesSet
 

Constructor Detail

TypeInferringSerializer

public TypeInferringSerializer()
Method Detail

get

public static <T> TypeInferringSerializer<T> get()

toByteBuffer

public java.nio.ByteBuffer toByteBuffer(T obj)
Description copied from interface: Serializer
Extract bytes from the obj of type T

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

fromByteBuffer

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

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