Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.coders
Class CollectionCoder<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.StandardCoder<IterableT>
-
- com.google.cloud.dataflow.sdk.coders.IterableLikeCoder<T,Collection<T>>
-
- com.google.cloud.dataflow.sdk.coders.CollectionCoder<T>
-
- All Implemented Interfaces:
- Coder<Collection<T>>, Serializable
public class CollectionCoder<T> extends IterableLikeCoder<T,Collection<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
CollectionCoder(Coder<T> elemCoder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected Collection<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(Collection<T> exampleValue)
Returns the first element in this collection if it is non-empty, otherwise returnsnull
.static <T> CollectionCoder<T>
of(Coder<T> elemCoder)
static CollectionCoder<?>
of(List<Object> components)
-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.IterableLikeCoder
decode, encode, getCoderArguments, getElemCoder, getInstanceComponentsHelper, isRegisterByteSizeObserverCheap, registerByteSizeObserver, verifyDeterministic
-
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
-
of
public static <T> CollectionCoder<T> of(Coder<T> elemCoder)
-
decodeToIterable
protected final Collection<T> decodeToIterable(List<T> decodedElements)
Builds an instance ofIterableT
, this coder's associatedIterable
-like subtype, from a list of decoded elements.- Specified by:
decodeToIterable
in classIterableLikeCoder<T,Collection<T>>
- Returns:
- the decoded elements directly, since
List
is a subtype ofCollection
.
-
of
public static CollectionCoder<?> of(List<Object> components)
-
getInstanceComponents
public static <T> List<Object> getInstanceComponents(Collection<T> exampleValue)
Returns the first element in this collection if it is non-empty, otherwise returnsnull
.
-
-