me.prettyprint.cassandra.serializers
Class StringSerializer

java.lang.Object
  extended by me.prettyprint.cassandra.serializers.AbstractSerializer<String>
      extended by me.prettyprint.cassandra.serializers.StringSerializer
All Implemented Interfaces:
Serializer<String>

public final class StringSerializer
extends AbstractSerializer<String>

A StringSerializer translates the byte[] to and from string using utf-8 encoding.

Author:
Ran Tavory

Constructor Summary
StringSerializer()
           
 
Method Summary
 String fromByteBuffer(ByteBuffer byteBuffer)
          Extract an object of type T from the bytes.
static StringSerializer get()
           
 ComparatorType getComparatorType()
           
 ByteBuffer toByteBuffer(String obj)
          Extract bytes from the obj of type T
 
Methods inherited from class me.prettyprint.cassandra.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, toBytes, toBytesList, toBytesMap, toBytesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringSerializer

public StringSerializer()
Method Detail

get

public static StringSerializer get()

toByteBuffer

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

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

fromByteBuffer

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

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

getComparatorType

public ComparatorType getComparatorType()
Specified by:
getComparatorType in interface Serializer<String>
Overrides:
getComparatorType in class AbstractSerializer<String>


Copyright © 2011. All Rights Reserved.