MapElements<InputT, OutputT> is a PTransform of a PCollection of type InputT to a PCollection of type OutputT.

PCollection<? extends InputT> ~~[MapElements<InputT, OutputT>]~~> PCollection<OutputT>

Creating Instance

MapElements takes the following to be created:

  • Contextful<Fn<InputT, OutputT>>

  • originalFnForDisplayData

  • TypeDescriptor<InputT>

  • TypeDescriptor<OutputT>

MapElements is created using MapElements.via and MapElements.into utilities.

MapElements.via Utility

MapElements<NewInputT, OutputT> via(
  Contextful<Fn<NewInputT, OutputT>> fn)
MapElements<InputT, OutputT> via(
  InferableFunction<InputT, OutputT> fn)
MapElements<NewInputT, OutputT> via(
  ProcessFunction<NewInputT, OutputT> fn)
MapElements<NewInputT, OutputT> via(
  SerializableFunction<NewInputT, OutputT> fn)
MapElements<InputT, OutputT> via(
  SimpleFunction<InputT, OutputT> fn)

via creates a MapElements for the given function.

MapElements.into Utility

MapElements<?, OutputT> into(
  TypeDescriptor<OutputT> outputType)