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 the DataGeneratorSource 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);