T - the type of the values being transcodedpublic abstract class AtomicCoder<T> extends StructuredCoder<T>
Coder that has no component Coders or other configuration.
Unless the behavior is overridden, atomic coders are presumed to be deterministic.
All atomic coders of the same class are considered to be equal to each other. As a result, an
AtomicCoder should have no associated configuration (instance variables, etc).
Coder.Context, Coder.NonDeterministicException| Constructor and Description |
|---|
AtomicCoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other)
.
|
java.util.List<? extends Coder<?>> |
getCoderArguments()
|
java.util.List<? extends Coder<?>> |
getComponents()
|
int |
hashCode()
.
|
void |
verifyDeterministic()
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
toStringconsistentWithEquals, decode, decode, encode, encode, getEncodedElementByteSize, getEncodedTypeDescriptor, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, verifyDeterministic, verifyDeterministicpublic 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.
Unless overridden, does not throw. An AtomicCoder is presumed to be deterministic
verifyDeterministic in class Coder<T>NonDeterministicException - if overridden to indicate that this sublcass of AtomicCoder is not deterministicCoder.NonDeterministicException - if this coder is not deterministic.public java.util.List<? extends Coder<?>> getCoderArguments()
Coder for a parameterized type, returns the list of Coders 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..getCoderArguments in class Coder<T>public final java.util.List<? extends Coder<?>> getComponents()
Coders that are components of this Coder.
The default components will be equal to the value returned by Coder.getCoderArguments()..
getComponents in class StructuredCoder<T>List.public final boolean equals(java.lang.Object other)
equals in class StructuredCoder<T>AtomicCoder.public final int hashCode()
hashCode in class StructuredCoder<T>hashCode() of the Class of this AtomicCoder.