T
- the type of values being encoded and decodedpublic abstract class CustomCoder<T> extends Coder<T> implements java.io.Serializable
Coder
except Coder.encode(T, java.io.OutputStream)
and Coder.decode(java.io.InputStream)
.Coder.Context, Coder.NonDeterministicException
Constructor and Description |
---|
CustomCoder() |
Modifier and Type | Method and Description |
---|---|
java.util.List<? extends Coder<?>> |
getCoderArguments()
|
void |
verifyDeterministic()
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
consistentWithEquals, decode, decode, encode, encode, getEncodedElementByteSize, getEncodedTypeDescriptor, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, verifyDeterministic, verifyDeterministic
public java.util.List<? extends Coder<?>> getCoderArguments()
Coder
for a parameterized type, returns the list of Coder
s being
used for each of the parameters in the same order they appear within the parameterized type's
type signature. If this cannot be done, or this Coder
does not encode/decode a
parameterized type, returns the empty list..
Returns an empty list. A CustomCoder
has no default argument coders
.
getCoderArguments
in class Coder<T>
public void verifyDeterministic() throws Coder.NonDeterministicException
Coder.NonDeterministicException
if the coding is not deterministic.
In order for a Coder
to be considered deterministic, the following must be true:
Object.equals()
or Comparable.compareTo()
, if supported) have the same encoding.
Coder
always produces a canonical encoding, which is the same for an instance
of an object even if produced on different computers at different times.
verifyDeterministic
in class Coder<T>
NonDeterministicException
- a CustomCoder
is presumed nondeterministic.Coder.NonDeterministicException
- if this coder is not deterministic.