com.netflix.astyanax.serializers
Class IntegerSerializer

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

public final class IntegerSerializer
extends AbstractSerializer<Integer>

Converts bytes to Integer and vice versa

Author:
Bozhidar Bozhanov

Constructor Summary
IntegerSerializer()
           
 
Method Summary
 Integer fromByteBuffer(ByteBuffer byteBuffer)
          Extract an object of type T from the bytes.
 Integer fromBytes(byte[] bytes)
           
 ByteBuffer fromString(String str)
          Create a ByteBuffer by first parsing the type out of a string
static IntegerSerializer get()
           
 ByteBuffer getNext(ByteBuffer byteBuffer)
          Return the byte buffer for the next value in sorted order for the matching comparator type.
 String getString(ByteBuffer byteBuffer)
           
 ByteBuffer toByteBuffer(Integer obj)
          Extract bytes from the obj of type T
 
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer
computeInitialHashSize, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, toBytes, toBytesList, toBytesList, toBytesMap, toBytesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerSerializer

public IntegerSerializer()
Method Detail

get

public static IntegerSerializer get()

toByteBuffer

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

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

fromByteBuffer

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

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

fromBytes

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

fromString

public ByteBuffer fromString(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<Integer>
Overrides:
fromString in class AbstractSerializer<Integer>
Returns:

getString

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

getNext

public ByteBuffer getNext(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<Integer>
Overrides:
getNext in class AbstractSerializer<Integer>
Returns:


Copyright © 2012. All Rights Reserved.