public class InstantCoder extends AtomicCoder<Instant>
Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
boolean |
consistentWithEquals()
Returns true if the encoded bytes of two objects are
equal only when they are also equal according to
Object.equals(). |
Instant |
decode(java.io.InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(Instant value,
java.io.OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
boolean |
isDeterministic()
Deprecated.
|
static InstantCoder |
of() |
void |
verifyDeterministic()
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
getCoderArguments, getInstanceComponentsasCloudObject, equals, getComponents, getEncodedElementByteSize, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static InstantCoder of()
public void encode(Instant value, java.io.OutputStream outStream, Coder.Context context) throws CoderException, java.io.IOException
CoderT onto the given output stream
in the given context.CoderException - if the value could not be encoded for some reasonjava.io.IOException - if writing to the OutputStream fails
for some reasonpublic Instant decode(java.io.InputStream inStream, Coder.Context context) throws CoderException, java.io.IOException
CoderT from the given input stream in
the given context. Returns the decoded value.CoderException - if the value could not be decoded for some reasonjava.io.IOException - if reading from the InputStream fails
for some reason@Deprecated public boolean isDeterministic()
Coder 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.
public void verifyDeterministic()
CoderCoder.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 interface Coder<Instant>verifyDeterministic in class StandardCoder<Instant>public boolean consistentWithEquals()
CoderObject.equals().
(and also implements a compatible Object.hasCode())
This most notably false for arrays. It will generally
be false when Object.equals() compares object identity,
rather than performing a semantic/structural comparison.
consistentWithEquals in interface Coder<Instant>consistentWithEquals in class StandardCoder<Instant>