me.prettyprint.cassandra.serializers
Class IntegerSerializer

java.lang.Object
  extended by me.prettyprint.cassandra.serializers.AbstractSerializer<Integer>
      extended by me.prettyprint.cassandra.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)
           
static IntegerSerializer get()
           
 ByteBuffer toByteBuffer(Integer obj)
          Extract bytes from the obj of type T
 
Methods inherited from class me.prettyprint.cassandra.serializers.AbstractSerializer
computeInitialHashSize, fromBytesList, fromBytesMap, 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

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>


Copyright © 2011. All Rights Reserved.