T - The type of objects coded.public class StringDelegateCoder<T> extends DelegateCoder<T,String>
StringDelegateCoder<T> wraps a Coder<String>
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<InputT,OutputT>Coder.Context, Coder.NonDeterministicException| Modifier | Constructor and Description |
|---|---|
protected |
StringDelegateCoder(Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
static <T> StringDelegateCoder<T> |
of(Class<T> clazz) |
String |
toString() |
decode, encode, of, structuralValue, verifyDeterministicasCloudObject, ofgetCoderArguments, getInstanceComponentsconsistentWithEquals, equals, getComponents, getEncodedElementByteSize, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, verifyDeterministic, verifyDeterministicpublic static <T> StringDelegateCoder<T> of(Class<T> clazz)
public String toString()
toString in class DelegateCoder<T,String>