com.google.cloud.dataflow.sdk.coders

## Class ListCoder<T>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.coders.StandardCoder<IterableT>
  - - com.google.cloud.dataflow.sdk.coders.IterableLikeCoder<T,List<T>>
    - - com.google.cloud.dataflow.sdk.coders.ListCoder<T>

Type Parameters:
  `T` - the type of the elements of the Lists being transcoded

All Implemented Interfaces:
  Coder<List<T>>, Serializable

    public class ListCoder<T>
    extends IterableLikeCoder<T,List<T>>

A `Coder` for `List`, using the format of `IterableLikeCoder`.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.google.cloud.dataflow.sdk.coders.Coder

`Coder.Context, Coder.NonDeterministicException`

### Constructor Summary

Constructors
`protected` `ListCoder(Coder<T> elemCoder)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected List<T>` `decodeToIterable(List<T> decodedElements)` Builds an instance of `IterableT`, this coder's associated `Iterable`-like subtype, from a list of decoded elements.
`static <T> List<Object>` `getInstanceComponents(List<T> exampleValue)` Returns the first element in this list if it is non-empty, otherwise returns `null`.
`static <T> ListCoder<T>` `of(Coder<T> elemCoder)`
`static ListCoder<?>` `of(List<Coder<?>> components)`
`void` `verifyDeterministic()` List sizes are always known, so ListIterable may be deterministic while the general IterableLikeCoder is not.

### Methods inherited from class com.google.cloud.dataflow.sdk.coders.IterableLikeCoder

`decode, encode, getCoderArguments, getElemCoder, getInstanceComponentsHelper, isRegisterByteSizeObserverCheap, registerByteSizeObserver`

### Methods inherited from class com.google.cloud.dataflow.sdk.coders.StandardCoder

`asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodedElementByteSize, getEncodingId, hashCode, structuralValue, toString, verifyDeterministic, verifyDeterministic`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ListCoder

    protected ListCoder(Coder<T> elemCoder)

### Method Detail

#### of

    public static <T> ListCoder<T> of(Coder<T> elemCoder)

#### decodeToIterable

    protected final List<T> decodeToIterable(List<T> decodedElements)

Description copied from class: `IterableLikeCoder`
Builds an instance of `IterableT`, this coder's associated `Iterable`-like subtype, from a list of decoded elements.

Specified by:
  `decodeToIterable` in class `IterableLikeCoder<T,List<T>>`

#### of

    public static ListCoder<?> of(List<Coder<?>> components)

#### getInstanceComponents

    public static <T> List<Object> getInstanceComponents(List<T> exampleValue)

Returns the first element in this list if it is non-empty, otherwise returns `null`.

#### verifyDeterministic

    public void verifyDeterministic()
                             throws Coder.NonDeterministicException

List sizes are always known, so ListIterable may be deterministic while the general IterableLikeCoder is not.

Specified by:
  `verifyDeterministic` in interface `Coder<List<T>>`
Overrides:
  `verifyDeterministic` in class `IterableLikeCoder<T,List<T>>`
Throws:
  `Coder.NonDeterministicException` - if this coder is not deterministic.