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:
java.io.Serializable
,PCollectionViews.HasDefaultValue<T>
- Enclosing class:
- PCollectionViews
@Experimental(CORE_RUNNERS_ONLY) @Internal public static class PCollectionViews.SingletonViewFn2<T> extends ViewFn<Materializations.IterableView<T>,T> implements PCollectionViews.HasDefaultValue<T>
Implementation which is able to adapt an iterable materialization to aT
.For internal use only.
PCollectionViews.SingletonViewFn
is meant to be removed in the future and replaced with this class.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
apply(Materializations.IterableView<T> primitiveViewT)
A function to adapt a primitive view type to a desired view type.T
getDefaultValue()
Returns the default value that was specified.Materialization<Materializations.IterableView<T>>
getMaterialization()
Gets the materialization of thisViewFn
.TypeDescriptor<T>
getTypeDescriptor()
Return theTypeDescriptor
describing the output of this fn.boolean
hasDefault()
Returns if a default value was specified.
-
-
-
Method Detail
-
hasDefault
@Internal public boolean hasDefault()
Returns if a default value was specified.
-
getDefaultValue
public T getDefaultValue()
Returns the default value that was specified.For internal use only.
- Specified by:
getDefaultValue
in interfacePCollectionViews.HasDefaultValue<T>
- Throws:
java.util.NoSuchElementException
- if no default was specified.
-
getMaterialization
public Materialization<Materializations.IterableView<T>> getMaterialization()
Description copied from class:ViewFn
Gets the materialization of thisViewFn
.- Specified by:
getMaterialization
in classViewFn<Materializations.IterableView<T>,T>
-
apply
public T apply(Materializations.IterableView<T> primitiveViewT)
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
public TypeDescriptor<T> getTypeDescriptor()
Description copied from class:ViewFn
Return theTypeDescriptor
describing the output of this fn.- Specified by:
getTypeDescriptor
in classViewFn<Materializations.IterableView<T>,T>
-
-