MapElements

The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.

MapElements can be used to simplify DoFn that maps an element to another element (one to one).

Kata: Implement a simple map function that multiplies all input elements by 5 using MapElements.into(...).via(...).


Use MapElements.into(...).via(...).
Refer to the Beam Programming Guide "Lightweight DoFns and other abstractions" section for more information.