public static class ValueWithRecordId.ValueWithRecordIdCoder<ValueT> extends StandardCoder<ValueWithRecordId<ValueT>>
Coder.Context, Coder.NonDeterministicException| Modifier | Constructor and Description |
|---|---|
protected |
ValueWithRecordIdCoder(Coder<ValueT> valueCoder) |
| Modifier and Type | Method and Description |
|---|---|
ValueWithRecordId<ValueT> |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(ValueWithRecordId<ValueT> value,
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. |
Coder<ValueT> |
getValueCoder() |
static <ValueT> ValueWithRecordId.ValueWithRecordIdCoder<ValueT> |
of(Coder<ValueT> valueCoder) |
static <ValueT> ValueWithRecordId.ValueWithRecordIdCoder<ValueT> |
of(List<Coder<ValueT>> 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 <ValueT> ValueWithRecordId.ValueWithRecordIdCoder<ValueT> of(Coder<ValueT> valueCoder)
public static <ValueT> ValueWithRecordId.ValueWithRecordIdCoder<ValueT> of(List<Coder<ValueT>> components)
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 void encode(ValueWithRecordId<ValueT> value, 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 ValueWithRecordId<ValueT> 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.