T - The type of objects coded.public class StringDelegateCoder<T> extends DelegateCoder<T,java.lang.String>
StringDelegateCoder<T> wraps a Coder
and encodes/decodes values of type T via string representations.
To decode, the input byte stream is decoded to
a String, and this is passed to the single-arg
constructor for T.
To encode, the input value is converted via toString(),
and this string is encoded.
In order for this to operate correctly for a class Clazz,
it must be the case for any instance x that
x.equals(new Clazz(x.toString())).
DelegateCoder.CodingFunction<Input,Output>Coder.Context, Coder.NonDeterministicException| Modifier | Constructor and Description |
|---|---|
protected |
StringDelegateCoder(java.lang.Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
static <T> StringDelegateCoder<T> |
of(java.lang.Class<T> clazz) |
java.lang.String |
toString() |
decode, encode, isDeterministic, of, verifyDeterministicasCloudObject, ofgetCoderArguments, getInstanceComponentsequals, getComponents, getEncodedElementByteSize, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, verifyDeterministic, verifyDeterministicprotected StringDelegateCoder(java.lang.Class<T> clazz)
public static <T> StringDelegateCoder<T> of(java.lang.Class<T> clazz)
public java.lang.String toString()
toString in class DelegateCoder<T,java.lang.String>