com.netflix.astyanax.serializers
Class StringSerializer
java.lang.Object
com.netflix.astyanax.serializers.AbstractSerializer<String>
com.netflix.astyanax.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
Methods inherited from class com.netflix.astyanax.serializers.AbstractSerializer |
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getNext, toBytes, toBytesList, toBytesList, toBytesMap, toBytesSet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringSerializer
public StringSerializer()
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>
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<String>
- Overrides:
fromString
in class AbstractSerializer<String>
- Returns:
getString
public String getString(ByteBuffer byteBuffer)
- Specified by:
getString
in interface Serializer<String>
- Overrides:
getString
in class AbstractSerializer<String>
Copyright © 2012. All Rights Reserved.