public class EntityCoder extends AtomicCoder<com.google.api.services.datastore.DatastoreV1.Entity>
Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
com.google.api.services.datastore.DatastoreV1.Entity |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(com.google.api.services.datastore.DatastoreV1.Entity value,
OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
protected long |
getEncodedElementByteSize(com.google.api.services.datastore.DatastoreV1.Entity value,
Coder.Context context)
Returns the size in bytes of the encoded value using this
coder.
|
static EntityCoder |
of() |
void |
verifyDeterministic()
A datastore kind can hold arbitrary Object instances, which
makes the encoding non-deterministic.
|
getCoderArguments, getInstanceComponentsasCloudObject, consistentWithEquals, equals, getComponents, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static EntityCoder of()
public void encode(com.google.api.services.datastore.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 com.google.api.services.datastore.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(com.google.api.services.datastore.DatastoreV1.Entity value,
Coder.Context context)
throws Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<com.google.api.services.datastore.DatastoreV1.Entity>Exceptionpublic void verifyDeterministic()
throws Coder.NonDeterministicException
verifyDeterministic in interface Coder<com.google.api.services.datastore.DatastoreV1.Entity>verifyDeterministic in class DeterministicStandardCoder<com.google.api.services.datastore.DatastoreV1.Entity>Coder.NonDeterministicException - if this coder is not deterministic.