com.netflix.astyanax.serializers
Class Int32Serializer

java.lang.Object
  extended by com.netflix.astyanax.serializers.AbstractSerializer<java.lang.Integer>
      extended by com.netflix.astyanax.serializers.Int32Serializer
All Implemented Interfaces:
Serializer<java.lang.Integer>

public class Int32Serializer
extends AbstractSerializer<java.lang.Integer>

Same as IntegerSerializer but more explicitly linked with Int32Type cmparator in cassandra.


Constructor Summary
Int32Serializer()
           
 
Method Summary
 java.lang.Integer fromByteBuffer(java.nio.ByteBuffer byteBuffer)
          Extract an object of type T from the bytes.
 java.lang.Integer fromBytes(byte[] bytes)
           
 java.nio.ByteBuffer fromString(java.lang.String str)
          Create a ByteBuffer by first parsing the type out of a string
static IntegerSerializer get()
           
 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(java.lang.Integer obj)
          Extract bytes from the obj of type T
 
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer
computeInitialHashSize, fromBytesList, fromBytesMap, fromBytesSet, 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

Int32Serializer

public Int32Serializer()
Method Detail

get

public static IntegerSerializer get()

toByteBuffer

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

Specified by:
toByteBuffer in interface Serializer<java.lang.Integer>
Specified by:
toByteBuffer in class AbstractSerializer<java.lang.Integer>
Returns:

fromByteBuffer

public java.lang.Integer 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<java.lang.Integer>
Specified by:
fromByteBuffer in class AbstractSerializer<java.lang.Integer>
Returns:

fromBytes

public java.lang.Integer fromBytes(byte[] bytes)
Specified by:
fromBytes in interface Serializer<java.lang.Integer>
Overrides:
fromBytes in class AbstractSerializer<java.lang.Integer>

fromString

public java.nio.ByteBuffer fromString(java.lang.String str)
Description copied from interface: Serializer
Create a ByteBuffer by first parsing the type out of a string

Specified by:
fromString in interface Serializer<java.lang.Integer>
Overrides:
fromString in class AbstractSerializer<java.lang.Integer>
Returns:

getString

public java.lang.String getString(java.nio.ByteBuffer byteBuffer)
Specified by:
getString in interface Serializer<java.lang.Integer>
Overrides:
getString in class AbstractSerializer<java.lang.Integer>

getNext

public java.nio.ByteBuffer getNext(java.nio.ByteBuffer byteBuffer)
Description copied from interface: Serializer
Return the byte buffer for the next value in sorted order for the matching comparator type. This is used for paginating columns.

Specified by:
getNext in interface Serializer<java.lang.Integer>
Overrides:
getNext in class AbstractSerializer<java.lang.Integer>
Returns:

getComparatorType

public ComparatorType getComparatorType()
Specified by:
getComparatorType in interface Serializer<java.lang.Integer>
Overrides:
getComparatorType in class AbstractSerializer<java.lang.Integer>