Google Cloud Dataflow SDK for Java, version 1.9.1
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>>
- 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 Modifier Constructor and Description protected
ListCoder(Coder<T> elemCoder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected List<T>
decodeToIterable(List<T> decodedElements)
Builds an instance ofIterableT
, this coder's associatedIterable
-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 returnsnull
.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
-
-
-
-
Method Detail
-
decodeToIterable
protected final List<T> decodeToIterable(List<T> decodedElements)
Description copied from class:IterableLikeCoder
Builds an instance ofIterableT
, this coder's associatedIterable
-like subtype, from a list of decoded elements.- Specified by:
decodeToIterable
in classIterableLikeCoder<T,List<T>>
-
getInstanceComponents
public static <T> List<Object> getInstanceComponents(List<T> exampleValue)
Returns the first element in this list if it is non-empty, otherwise returnsnull
.
-
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 interfaceCoder<List<T>>
- Overrides:
verifyDeterministic
in classIterableLikeCoder<T,List<T>>
- Throws:
Coder.NonDeterministicException
- if this coder is not deterministic.
-
-