T - the type of (de)serialized objects@ParametersAreNonnullByDefault public abstract class AbstractStringSerializer<T> extends Object implements StringSerializer<T>
StringSerializer for objects of type T.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStringSerializer(BinarySerializer<T> serializer)
Constructs a new
BinarySerializer. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract byte[] |
decode(String data)
Decodes a
String into its binary representation. |
T |
deserialize(String data)
Reads and assembles an object of type
T from the given data. |
protected abstract String |
encode(byte[] data)
Encodes a
byte array into its literal representation. |
String |
serialize(T t)
Write an object of type
T into its basic representation. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvert, revertprotected AbstractStringSerializer(@Nonnull BinarySerializer<T> serializer)
BinarySerializer.serializer - the serializer to use before applying a String encoding or decoding@Nonnull public String serialize(T t)
SerializerT into its basic representation.serialize in interface Serializer<T,String>t - the object to serialize@Nonnull public T deserialize(String data)
SerializerT from the given data.deserialize in interface Serializer<T,String>data - the basic representation of the object@Nonnull protected abstract String encode(byte[] data)
byte array into its literal representation.data - a byte arrayCopyright © 2017–2019 Atlanmod. All rights reserved.