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_COMPRESSION_THRESHOLD |
| Constructor and Description |
|---|
StringSerializer() |
| Modifier and Type | Method and Description |
|---|---|
String |
convert(Object value)
Converts the given (not-null) value to the expected data type 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_COMPRESSION_THRESHOLD
public String readByteOrder(ScanBuffer buffer)
OrderPreservingSerializerIt is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
readByteOrder in interface OrderPreservingSerializer<String>buffer - ReadBuffer to read attribute frompublic void writeByteOrder(WriteBuffer buffer, String attribute)
OrderPreservingSerializerIt is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
writeByteOrder in interface OrderPreservingSerializer<String>buffer - WriteBuffer to write attribute toattribute - Attribute to write to WriteBufferpublic void verifyAttribute(String value)
AttributeSerializerIllegalArgumentException if the value is invalid,
otherwise simply returns.verifyAttribute in interface AttributeSerializer<String>value - to verifypublic String convert(Object value)
AttributeSerializerIllegalArgumentException if it cannot be converted.convert in interface AttributeSerializer<String>value - to convertpublic String read(ScanBuffer buffer)
AttributeSerializerIt is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
read in interface AttributeSerializer<String>buffer - ReadBuffer to read attribute frompublic void write(WriteBuffer buffer, String attribute)
AttributeSerializerIt is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
write in interface AttributeSerializer<String>buffer - WriteBuffer to write attribute toattribute - Attribute to write to WriteBufferCopyright © 2012–2024. All rights reserved.