# Package com.google.cloud.dataflow.sdk.coders

Defines `Coders` to specify how data is encoded to and decoded from byte strings.

See: Description

Interface Summary
Coder<T>: A `Coder<T>` defines how to encode and decode values of type `T` into byte streams.
CoderFactory: A `CoderFactory` creates coders and decomposes values.
CoderProvider: A `CoderProvider` may create a `Coder` for any concrete class.
DelegateCoder.CodingFunction<InputT,OutputT>: A `CodingFunction<InputT, OutputT>` is a serializable function from `InputT` to `OutputT` that may throw any `Exception`.

Class Summary
AtomicCoder<T>: A `Coder` that has no component `Coders` or other state.
AvroCoder<T>: A `Coder` using Avro binary format.
BigEndianIntegerCoder: A `BigEndianIntegerCoder` encodes `Integers` in 4 bytes, big-endian.
BigEndianLongCoder: A `BigEndianLongCoder` encodes `Long`s in 8 bytes, big-endian.
ByteArrayCoder: A `Coder` for `byte[]`.
ByteCoder: A `ByteCoder` encodes `Byte` values in 1 byte using Java serialization.
ByteStringCoder: A `Coder` for `ByteString` objects based on their encoded Protocol Buffer form.
Coder.Context: The context in which encoding or decoding is being done.
Coder.NonDeterministicException: Exception thrown by `Coder.verifyDeterministic()` if the encoding is not deterministic, including details of why the encoding is not deterministic.
CoderFactories: Static utility methods for creating and working with `Coder`s.
CoderProviders: Static utility methods for working with `CoderProviders`.
CoderRegistry: A `CoderRegistry` allows registering the default `Coder` to use for a Java class, and looking up and instantiating the default `Coder` for a Java type.
CollectionCoder<T>: A `CollectionCoder` encodes `Collections` in the format of `IterableLikeCoder`.
CustomCoder<T>: An abstract base class for writing a `Coder` class that encodes itself via Java serialization.
DelegateCoder<T,IntermediateT>: A `DelegateCoder<T, IntermediateT>` wraps a `Coder` for `IntermediateT` and encodes/decodes values of type `T` by converting to/from `IntermediateT` and then encoding/decoding using the underlying `Coder<IntermediateT>`.
DeterministicStandardCoder<T>: A `DeterministicStandardCoder` is a `StandardCoder` that is deterministic, in the sense that for objects considered equal according to `Object.equals(Object)`, the encoded bytes are also equal.
DoubleCoder: A `DoubleCoder` encodes `Double` values in 8 bytes using Java serialization.
DurationCoder: A `Coder` that encodes a joda `Duration` as a `Long` using the format of `VarLongCoder`.
EntityCoder: Deprecated use `ProtoCoder` instead.
InstantCoder: A `Coder` for joda `Instant` that encodes it as a big endian `Long` shifted such that lexicographic ordering of the bytes corresponds to chronological order.
IterableCoder<T>: An `IterableCoder` encodes any `Iterable` in the format of `IterableLikeCoder`.
IterableLikeCoder<T,IterableT extends Iterable<T>>: An abstract base class with functionality for assembling a `Coder` for a class that implements `Iterable`.
JAXBCoder<T>: A coder for JAXB annotated objects.
KvCoder<K,V>: A `KvCoder` encodes `KV`s.
KvCoderBase<T>: Deprecated
ListCoder<T>: A `Coder` for `List`, using the format of `IterableLikeCoder`.
MapCoder<K,V>: A `Coder` for `Maps` that encodes them according to provided coders for keys and values.
MapCoderBase<T>: Deprecated
NullableCoder<T>: A `NullableCoder` encodes nullable values of type `T` using a nested `Coder<T>` that does not tolerate `null` values.
Proto2Coder<T extends com.google.protobuf.Message>: Deprecated Use `ProtoCoder`.
SerializableCoder<T extends Serializable>: A `Coder` for Java classes that implement `Serializable`.
SetCoder<T>: A `SetCoder` encodes any `Set` using the format of `IterableLikeCoder`.
StandardCoder<T>: An abstract base class to implement a `Coder` that defines equality, hashing, and printing via the class name and recursively using `StandardCoder.getComponents()`.
StringDelegateCoder<T>: A `Coder` that wraps a `Coder<String>` and encodes/decodes values via string representations.
StringUtf8Coder: A `Coder` that encodes `Strings` in UTF-8 encoding.
StructuralByteArray: A wrapper around a byte[] that uses structural, value-based equality rather than byte[]'s normal object identity.
TableRowJsonCoder: A `Coder` that encodes BigQuery `TableRow` objects in their native JSON format.
TextualIntegerCoder: A `Coder` that encodes `Integer Integers` as the ASCII bytes of their textual, decimal, representation.
VarIntCoder: A `Coder` that encodes `Integers` using between 1 and 5 bytes.
VarLongCoder: A `Coder` that encodes `Longs` using between 1 and 10 bytes.
VoidCoder: A `Coder` for `Void`.

Enum Summary
CannotProvideCoderException.ReasonCode: Indicates the reason that `Coder` inference failed.

Exception Summary
CannotProvideCoderException: The exception thrown when a `CoderProvider` cannot provide a `Coder` that has been requested.
CoderException: An `Exception` thrown if there is a problem encoding or decoding a value.

Annotation Types Summary
DefaultCoder: The `DefaultCoder` annotation specifies a default `Coder` class to handle encoding and decoding instances of the annotated class.

## Package com.google.cloud.dataflow.sdk.coders Description

Defines `Coders` to specify how data is encoded to and decoded from byte strings.

During execution of a Pipeline, elements in a `PCollection` may need to be encoded into byte strings. This happens both at the beginning and end of a pipeline when data is read from and written to persistent storage and also during execution of a pipeline when elements are communicated between machines.

Exactly when PCollection elements are encoded during execution depends on which `PipelineRunner` is being used and how that runner chooses to execute the pipeline. As such, Dataflow requires that all PCollections have an appropriate Coder in case it becomes necessary. In many cases, the Coder can be inferred from the available Java type information and the Pipeline's `CoderRegistry`. It can be specified per PCollection via `PCollection.setCoder(Coder)` or per type using the `DefaultCoder` annotation.

This package provides a number of coders for common types like `Integer`, `String`, and `List`, as well as coders like `AvroCoder` that can be used to encode many custom types.