com.google.cloud.dataflow.sdk.coders

## Annotation Type DefaultCoder

    @Documented
     @Retention(value=RUNTIME)
     @Target(value=TYPE)
    public @interface DefaultCoder

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

The specified `Coder` must satisfy the requirements of `CoderProviders.fromStaticMethods(java.lang.Class<T>)`. Two classes provided by the SDK that are intended for use with this annotation include `SerializableCoder` and `AvroCoder`.

To configure the use of Java serialization as the default for a class, annotate the class to use `SerializableCoder` as follows:

     @DefaultCoder(SerializableCoder.class)
     public class MyCustomDataType implements Serializable {
       // ...
     }

Similarly, to configure the use of `AvroCoder` as the default:

     @DefaultCoder(AvroCoder.class)
     public class MyCustomDataType {
       public MyCustomDataType() {}  // Avro requires an empty constructor.
       // ...
     }

Coders specified explicitly via `PCollection.setCoder(com.google.cloud.dataflow.sdk.coders.Coder<T>)` take precedence, followed by Coders registered at runtime via `CoderRegistry.registerCoder(java.lang.Class<?>, java.lang.Class<?>)`. See `CoderRegistry` for a more detailed discussion of the precedence rules.

### Required Element Summary

Required Elements
`Class<? extends Coder>` `value`

### Element Detail

#### value

    public abstract Class<? extends Coder> value