Package org.apache.beam.sdk.coders
Class IterableCoder<T>
java.lang.Object
org.apache.beam.sdk.coders.Coder<Iterable<T>>
org.apache.beam.sdk.coders.StructuredCoder<Iterable<T>>
org.apache.beam.sdk.coders.IterableLikeCoder<T,Iterable<T>>
org.apache.beam.sdk.coders.IterableCoder<T>
- Type Parameters:
T- the type of the elements of the iterables being transcoded
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecodeToIterable(List<T> decodedElements) Builds an instance ofIterableT, this coder's associatedIterable-like subtype, from a list of decoded elements.Returns theTypeDescriptorfor the type encoded.static <T> IterableCoder<T> structuralValue(Iterable<T> value) Returns an object with anObject.equals()method that represents structural equality on the argument.Methods inherited from class org.apache.beam.sdk.coders.IterableLikeCoder
decode, decodeToIterable, encode, getCoderArguments, getElemCoder, isRegisterByteSizeObserverCheap, registerByteSizeObserver, verifyDeterministicMethods inherited from class org.apache.beam.sdk.coders.StructuredCoder
equals, getComponents, hashCode, toStringMethods inherited from class org.apache.beam.sdk.coders.Coder
consistentWithEquals, decode, encode, getEncodedElementByteSize, getEncodedElementByteSizeUsingCoder, verifyDeterministic, verifyDeterministic
-
Constructor Details
-
IterableCoder
-
-
Method Details
-
of
-
structuralValue
Description copied from class:CoderReturns an object with anObject.equals()method that represents structural equality on the argument.For any two values
xandyof typeT, if their encoded bytes are the same, then it must be the case thatstructuralValue(x).equals(structuralValue(y)).Most notably:
- The structural value for an array coder should perform a structural comparison of the contents of the arrays, rather than the default behavior of comparing according to object identity.
- The structural value for a coder accepting
nullshould be a proper object with anequals()method, even if the input value isnull.
See also
Coder.consistentWithEquals().By default, if this coder is
Coder.consistentWithEquals(), and the value is not null, returns the provided object. Otherwise, encodes the value into abyte[], and returns an object that performs array equality on the encoded bytes.- Overrides:
structuralValuein classCoder<Iterable<T>>
-
decodeToIterable
Description copied from class:IterableLikeCoderBuilds an instance ofIterableT, this coder's associatedIterable-like subtype, from a list of decoded elements.Override
IterableLikeCoder.decodeToIterable(List, long, InputStream)if you need access to the terminator value and theInputStream.- Specified by:
decodeToIterablein classIterableLikeCoder<T,Iterable<T>>
-
getEncodedTypeDescriptor
Description copied from class:CoderReturns theTypeDescriptorfor the type encoded.- Overrides:
getEncodedTypeDescriptorin classCoder<Iterable<T>>
-