Interface GeneratorFunction<T,O>
-
- Type Parameters:
T
- Type of the input elements.O
- Type of the returned elements.
- All Superinterfaces:
Function
,Serializable
- All Known Implementing Classes:
CarGeneratorFunction
,EventsGeneratorFunction
,FromElementsGeneratorFunction
,IndexLookupGeneratorFunction
@Experimental public interface GeneratorFunction<T,O> extends Function
Base interface for data generator functions. Data generator functions take elements and transform them, element-wise. They are the core building block of theDataGeneratorSource
that drives the data generation process by supplying "index" values of type Long. It makes it possible to produce specific elements at concrete positions of the generated data stream.Example:
GeneratorFunction<Long, String> generatorFunction = index -> "Number: " + index; DataGeneratorSource<String> source = new DataGeneratorSource<>(generatorFunction, 1000, Types.STRING);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Tear-down method for the function.O
map(T value)
default void
open(SourceReaderContext readerContext)
Initialization method for the function.
-
-
-
Method Detail
-
open
default void open(SourceReaderContext readerContext) throws Exception
Initialization method for the function. It is called once before the actual data mapping methods.- Throws:
Exception
-
-