Package org.apache.beam.sdk.values
Class PCollectionViews.SingletonViewFn2<T>
java.lang.Object
org.apache.beam.sdk.transforms.ViewFn<Materializations.IterableView<T>,T>
org.apache.beam.sdk.values.PCollectionViews.SingletonViewFn2<T>
- All Implemented Interfaces:
Serializable
,PCollectionViews.HasDefaultValue<T>
,PCollectionViews.IsSingletonView<T>
- Enclosing class:
PCollectionViews
@Internal
public static class PCollectionViews.SingletonViewFn2<T>
extends ViewFn<Materializations.IterableView<T>,T>
implements PCollectionViews.HasDefaultValue<T>, PCollectionViews.IsSingletonView<T>
Implementation which is able to adapt an iterable materialization to a
T
.
For internal use only.
PCollectionViews.SingletonViewFn
is meant to be removed in the future and replaced with this class.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Materializations.IterableView<T> primitiveViewT) A function to adapt a primitive view type to a desired view type.Returns the default value that was specified.Gets the materialization of thisViewFn
.Return theTypeDescriptor
describing the output of this fn.boolean
Returns if a default value was specified.
-
Method Details
-
hasDefault
Returns if a default value was specified. -
getDefaultValue
Returns the default value that was specified.For internal use only.
- Specified by:
getDefaultValue
in interfacePCollectionViews.HasDefaultValue<T>
- Throws:
NoSuchElementException
- if no default was specified.
-
getMaterialization
Description copied from class:ViewFn
Gets the materialization of thisViewFn
.- Specified by:
getMaterialization
in classViewFn<Materializations.IterableView<T>,
T>
-
apply
Description copied from class:ViewFn
A function to adapt a primitive view type to a desired view type.- Specified by:
apply
in classViewFn<Materializations.IterableView<T>,
T>
-
getTypeDescriptor
Description copied from class:ViewFn
Return theTypeDescriptor
describing the output of this fn.- Specified by:
getTypeDescriptor
in classViewFn<Materializations.IterableView<T>,
T>
-