public static class TimestampedValue.TimestampedValueCoder<T> extends StandardCoder<TimestampedValue<T>>
Coder for TimestampedValue.Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
TimestampedValue<T> |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(TimestampedValue<T> windowedElem,
OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
List<? extends Coder<?>> |
getCoderArguments()
If this is a
Coder for a parameterized type, returns the
list of Coders being used for each of the parameters, or
returns null if this cannot be done or this is not a
parameterized type. |
static <T> List<Object> |
getInstanceComponents(TimestampedValue<T> exampleValue) |
static <T> TimestampedValue.TimestampedValueCoder<T> |
of(Coder<T> valueCoder) |
static TimestampedValue.TimestampedValueCoder<?> |
of(List<Object> components) |
void |
verifyDeterministic()
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodedElementByteSize, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static <T> TimestampedValue.TimestampedValueCoder<T> of(Coder<T> valueCoder)
public static TimestampedValue.TimestampedValueCoder<?> of(List<Object> components)
public void encode(TimestampedValue<T> windowedElem, OutputStream outStream, Coder.Context context) throws IOException
CoderT onto the given output stream
in the given context.IOException - if writing to the OutputStream fails
for some reasonCoderException - if the value could not be encoded for some reasonpublic TimestampedValue<T> decode(InputStream inStream, Coder.Context context) throws IOException
CoderT from the given input stream in
the given context. Returns the decoded value.IOException - if reading from the InputStream fails
for some reasonCoderException - if the value could not be decoded for some reasonpublic void verifyDeterministic()
throws Coder.NonDeterministicException
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.
Coder.NonDeterministicException - if this coder is not deterministic.public List<? extends Coder<?>> getCoderArguments()
CoderCoder for a parameterized type, returns the
list of Coders being used for each of the parameters, or
returns null if this cannot be done or this is not a
parameterized type.public static <T> List<Object> getInstanceComponents(TimestampedValue<T> exampleValue)