T - public class EnumSerializer<T extends Enum<T>> extends Object implements Serializer<T>
Enums. The enum serializer can use different
ValueTranslators to encode enums in different ways.| Constructor and Description |
|---|
EnumSerializer(ValueTranslator translator) |
| Modifier and Type | Method and Description |
|---|---|
SerializerFormatDefinition |
getFormatDefinition()
Get the definition that describes what this serializer can
read and write.
|
T |
read(StreamingInput in)
Read an object from the specified stream.
|
void |
write(T object,
String name,
StreamingOutput stream)
Write and object to the specified stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromBytes, fromBytes, toBytes, toBytespublic EnumSerializer(ValueTranslator translator)
public T read(StreamingInput in) throws IOException
Serializerread in interface Serializer<T extends Enum<T>>IOExceptionpublic void write(T object, String name, StreamingOutput stream) throws IOException
Serializerwrite in interface Serializer<T extends Enum<T>>object - object to writename - the name it should have in the streamstream - the stream to useIOExceptionpublic SerializerFormatDefinition getFormatDefinition()
SerializergetFormatDefinition in interface Serializer<T extends Enum<T>>Copyright © 2017. All rights reserved.