public class StringSerializer extends Object implements OrderPreservingSerializer<String>, SupportsNullSerializer
Modifier and Type | Field and Description |
---|---|
static int |
LONG_COMPRESSION_THRESHOLD |
static int |
MAX_LENGTH |
static int |
TEXT_COMRPESSION_THRESHOLD |
Constructor and Description |
---|
StringSerializer() |
Modifier and Type | Method and Description |
---|---|
String |
convert(Object value)
Converts the given (not-null) value to the expected datatype V.
|
String |
read(ScanBuffer buffer)
Reads an attribute from the given ReadBuffer.
|
String |
readByteOrder(ScanBuffer buffer)
Reads an attribute from the given ReadBuffer assuming it was written in byte order.
|
void |
verifyAttribute(String value)
Verifies the given (not-null) attribute value is valid.
|
void |
write(WriteBuffer buffer,
String attribute)
Writes the attribute value to the given WriteBuffer.
|
void |
writeByteOrder(WriteBuffer buffer,
String attribute)
Writes the attribute value to the given WriteBuffer such that the byte order of the result is equal to the
natural order of the attribute.
|
public static final int MAX_LENGTH
public static final int LONG_COMPRESSION_THRESHOLD
public static final int TEXT_COMRPESSION_THRESHOLD
public String readByteOrder(ScanBuffer buffer)
OrderPreservingSerializer
readByteOrder
in interface OrderPreservingSerializer<String>
buffer
- ReadBuffer to read attribute frompublic void writeByteOrder(WriteBuffer buffer, String attribute)
OrderPreservingSerializer
writeByteOrder
in interface OrderPreservingSerializer<String>
buffer
- WriteBuffer to write attribute toattribute
- Attribute to write to WriteBufferpublic void verifyAttribute(String value)
AttributeSerializer
IllegalArgumentException
if the value is invalid,
otherwise simply returns.verifyAttribute
in interface AttributeSerializer<String>
value
- to verifypublic String convert(Object value)
AttributeSerializer
IllegalArgumentException
if it cannot be converted.convert
in interface AttributeSerializer<String>
value
- to convertpublic String read(ScanBuffer buffer)
AttributeSerializer
read
in interface AttributeSerializer<String>
buffer
- ReadBuffer to read attribute frompublic void write(WriteBuffer buffer, String attribute)
AttributeSerializer
write
in interface AttributeSerializer<String>
buffer
- WriteBuffer to write attribute toattribute
- Attribute to write to WriteBufferCopyright © 2012–2017. All rights reserved.