ProtoCoder instead.@Deprecated public class EntityCoder extends AtomicCoder<DatastoreV1.Entity>
Coder for DatastoreV1.Entity objects based on their encoded Protocol Buffer form.Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
DatastoreV1.Entity |
decode(InputStream inStream,
Coder.Context context)
Deprecated.
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(DatastoreV1.Entity value,
OutputStream outStream,
Coder.Context context)
Deprecated.
Encodes the given value of type
T onto the given output stream
in the given context. |
protected long |
getEncodedElementByteSize(DatastoreV1.Entity value,
Coder.Context context)
Deprecated.
Returns the size in bytes of the encoded value using this coder.
|
static EntityCoder |
of()
Deprecated.
|
void |
verifyDeterministic()
Deprecated.
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
getCoderArguments, getInstanceComponentsasCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static EntityCoder of()
public void encode(DatastoreV1.Entity value, OutputStream outStream, Coder.Context context) throws IOException, CoderException
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 DatastoreV1.Entity 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 reasonprotected long getEncodedElementByteSize(DatastoreV1.Entity value, Coder.Context context) throws Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<DatastoreV1.Entity>Exceptionpublic 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 interface Coder<DatastoreV1.Entity>verifyDeterministic in class DeterministicStandardCoder<DatastoreV1.Entity>NonDeterministicException - always.
A Datastore kind can hold arbitrary Object instances, which
makes the encoding non-deterministic.Coder.NonDeterministicException - if this coder is not deterministic.