All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fluxtion.ext.streaming.builder.stream.StreamFunctionsBuilder Maven / Gradle / Ivy

There is a newer version: 2.10.50
Show newest version
/*
 * Copyright (C) 2019 V12 Technology Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Server Side Public License, version 1,
 * as published by MongoDB, Inc.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Server Side License for more details.
 *
 * You should have received a copy of the Server Side Public License
 * along with this program.  If not, see 
 * .
 */
package com.fluxtion.ext.streaming.builder.stream;
import com.fluxtion.api.event.Event;
import com.fluxtion.api.partition.LambdaReflection.SerializableBiFunction;
import com.fluxtion.api.partition.LambdaReflection.SerializableFunction;
import com.fluxtion.api.partition.LambdaReflection.SerializableSupplier;
import com.fluxtion.ext.streaming.api.Wrapper;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Average;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Count;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Delta;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Max;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Min;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.PercentDelta;
import com.fluxtion.ext.streaming.api.stream.StreamFunctions.Sum;
import com.fluxtion.ext.streaming.builder.stream.FilterBuilder;
import com.fluxtion.ext.streaming.builder.util.FunctionArg;
import com.fluxtion.ext.streaming.builder.util.StreamFunctionGenerator;
import static com.fluxtion.ext.streaming.builder.event.EventSelect.*;
import static com.fluxtion.ext.streaming.builder.stream.FunctionBuilder.*;
import static com.fluxtion.ext.streaming.builder.stream.StreamBuilder.*;
import static com.fluxtion.ext.streaming.builder.util.FunctionArg.*;

/**
 * Utility class providing static helper methods to create mapping operations
 * in streams from a set of wrapped functions.
 *
 * This class is autogenerated from executing {@link StreamFunctionGenerator}
 *
 * @author Greg Higgins
 */
public class StreamFunctionsBuilder  {


    public static  SerializableBiFunction add() {
        return StreamFunctions::add;
    }

    public static  Wrapper add(SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::add, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper add(SerializableSupplier supplier1, SerializableSupplier supplier2) {
        return FilterBuilder.map(StreamFunctions::add, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper add(FunctionArg arg1, FunctionArg arg2) {
        return FilterBuilder.map(StreamFunctions::add, arg1, arg2);
    }

    public static  Wrapper add(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::add, arg(wrapper, supplier1), arg(wrapper, supplier2));
    }

    public static  Wrapper add(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::add, arg(wrapper1, supplier1), arg(wrapper2, supplier2));
    }

    public static  Wrapper add(Wrapper wrapper1, Wrapper wrapper2) {
        return FilterBuilder.map(StreamFunctions::add, arg(wrapper1), arg(wrapper2));
    }


    public static  SerializableBiFunction subtract() {
        return StreamFunctions::subtract;
    }

    public static  Wrapper subtract(SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper subtract(SerializableSupplier supplier1, SerializableSupplier supplier2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper subtract(FunctionArg arg1, FunctionArg arg2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg1, arg2);
    }

    public static  Wrapper subtract(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg(wrapper, supplier1), arg(wrapper, supplier2));
    }

    public static  Wrapper subtract(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg(wrapper1, supplier1), arg(wrapper2, supplier2));
    }

    public static  Wrapper subtract(Wrapper wrapper1, Wrapper wrapper2) {
        return FilterBuilder.map(StreamFunctions::subtract, arg(wrapper1), arg(wrapper2));
    }


    public static  SerializableBiFunction multiply() {
        return StreamFunctions::multiply;
    }

    public static  Wrapper multiply(SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper multiply(SerializableSupplier supplier1, SerializableSupplier supplier2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper multiply(FunctionArg arg1, FunctionArg arg2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg1, arg2);
    }

    public static  Wrapper multiply(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg(wrapper, supplier1), arg(wrapper, supplier2));
    }

    public static  Wrapper multiply(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg(wrapper1, supplier1), arg(wrapper2, supplier2));
    }

    public static  Wrapper multiply(Wrapper wrapper1, Wrapper wrapper2) {
        return FilterBuilder.map(StreamFunctions::multiply, arg(wrapper1), arg(wrapper2));
    }


    public static  SerializableBiFunction divide() {
        return StreamFunctions::divide;
    }

    public static  Wrapper divide(SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::divide, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper divide(SerializableSupplier supplier1, SerializableSupplier supplier2) {
        return FilterBuilder.map(StreamFunctions::divide, arg(supplier1), arg(supplier2));
    }

    public static  Wrapper divide(FunctionArg arg1, FunctionArg arg2) {
        return FilterBuilder.map(StreamFunctions::divide, arg1, arg2);
    }

    public static  Wrapper divide(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::divide, arg(wrapper, supplier1), arg(wrapper, supplier2));
    }

    public static  Wrapper divide(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
        return FilterBuilder.map(StreamFunctions::divide, arg(wrapper1, supplier1), arg(wrapper2, supplier2));
    }

    public static  Wrapper divide(Wrapper wrapper1, Wrapper wrapper2) {
        return FilterBuilder.map(StreamFunctions::divide, arg(wrapper1), arg(wrapper2));
    }


    /**
     * Wrap {@link Sum#addValue } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Sum#addValue }
     * @return {@link SerializableFunction} of {@link Sum#addValue }
     */
    public static  SerializableFunction cumSum() {
        return new Sum()::addValue;
    }

    /**
     * Performs a {@link Sum#addValue} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Sum#addValue
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Sum#addValue}
     */
    public static  Wrapper cumSum(SerializableFunction supplier) {
        return FilterBuilder.map(new Sum()::addValue, arg(supplier));
    }

    public static  Wrapper cumSum(FunctionArg arg) {
        return FilterBuilder.map(new Sum()::addValue, arg);
    }

    /**
     * Performs a {@link Sum#addValue} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Sum#addValue}
     * @param supplier The wrapped instance supplying values to the function {@link Sum#addValue
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Sum#addValue}
     */
    public static  Wrapper cumSum(SerializableSupplier supplier) {
        return FilterBuilder.map(new Sum()::addValue, arg(supplier));
    }

    public static  Wrapper cumSum(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new Sum()::addValue,  arg(wrapper, supplier));
    }

    public static  Wrapper cumSum(Wrapper wrapper) {
        return FilterBuilder.map(new Sum()::addValue,  arg(wrapper));
    }

    /**
     * Wrap {@link Average#addValue } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Average#addValue }
     * @return {@link SerializableFunction} of {@link Average#addValue }
     */
    public static  SerializableFunction avg() {
        return new Average()::addValue;
    }

    /**
     * Performs a {@link Average#addValue} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Average#addValue
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Average#addValue}
     */
    public static  Wrapper avg(SerializableFunction supplier) {
        return FilterBuilder.map(new Average()::addValue, arg(supplier));
    }

    public static  Wrapper avg(FunctionArg arg) {
        return FilterBuilder.map(new Average()::addValue, arg);
    }

    /**
     * Performs a {@link Average#addValue} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Average#addValue}
     * @param supplier The wrapped instance supplying values to the function {@link Average#addValue
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Average#addValue}
     */
    public static  Wrapper avg(SerializableSupplier supplier) {
        return FilterBuilder.map(new Average()::addValue, arg(supplier));
    }

    public static  Wrapper avg(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new Average()::addValue,  arg(wrapper, supplier));
    }

    public static  Wrapper avg(Wrapper wrapper) {
        return FilterBuilder.map(new Average()::addValue,  arg(wrapper));
    }

    /**
     * Wrap {@link Max#max } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Max#max }
     * @return {@link SerializableFunction} of {@link Max#max }
     */
    public static  SerializableFunction max() {
        return new Max()::max;
    }

    /**
     * Performs a {@link Max#max} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Max#max
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Max#max}
     */
    public static  Wrapper max(SerializableFunction supplier) {
        return FilterBuilder.map(new Max()::max, arg(supplier));
    }

    public static  Wrapper max(FunctionArg arg) {
        return FilterBuilder.map(new Max()::max, arg);
    }

    /**
     * Performs a {@link Max#max} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Max#max}
     * @param supplier The wrapped instance supplying values to the function {@link Max#max
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Max#max}
     */
    public static  Wrapper max(SerializableSupplier supplier) {
        return FilterBuilder.map(new Max()::max, arg(supplier));
    }

    public static  Wrapper max(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new Max()::max,  arg(wrapper, supplier));
    }

    public static  Wrapper max(Wrapper wrapper) {
        return FilterBuilder.map(new Max()::max,  arg(wrapper));
    }

    /**
     * Wrap {@link Min#min } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Min#min }
     * @return {@link SerializableFunction} of {@link Min#min }
     */
    public static  SerializableFunction min() {
        return new Min()::min;
    }

    /**
     * Performs a {@link Min#min} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Min#min
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Min#min}
     */
    public static  Wrapper min(SerializableFunction supplier) {
        return FilterBuilder.map(new Min()::min, arg(supplier));
    }

    public static  Wrapper min(FunctionArg arg) {
        return FilterBuilder.map(new Min()::min, arg);
    }

    /**
     * Performs a {@link Min#min} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Min#min}
     * @param supplier The wrapped instance supplying values to the function {@link Min#min
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Min#min}
     */
    public static  Wrapper min(SerializableSupplier supplier) {
        return FilterBuilder.map(new Min()::min, arg(supplier));
    }

    public static  Wrapper min(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new Min()::min,  arg(wrapper, supplier));
    }

    public static  Wrapper min(Wrapper wrapper) {
        return FilterBuilder.map(new Min()::min,  arg(wrapper));
    }

    /**
     * Wrap {@link PercentDelta#value } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link PercentDelta#value }
     * @return {@link SerializableFunction} of {@link PercentDelta#value }
     */
    public static  SerializableFunction percentChange() {
        return new PercentDelta()::value;
    }

    /**
     * Performs a {@link PercentDelta#value} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link PercentDelta#value
     * @return {@link  Wrapper<Number>} wrapping the result of {@link PercentDelta#value}
     */
    public static  Wrapper percentChange(SerializableFunction supplier) {
        return FilterBuilder.map(new PercentDelta()::value, arg(supplier));
    }

    public static  Wrapper percentChange(FunctionArg arg) {
        return FilterBuilder.map(new PercentDelta()::value, arg);
    }

    /**
     * Performs a {@link PercentDelta#value} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link PercentDelta#value}
     * @param supplier The wrapped instance supplying values to the function {@link PercentDelta#value
     * @return {@link  Wrapper<Number>} wrapping the result of {@link PercentDelta#value}
     */
    public static  Wrapper percentChange(SerializableSupplier supplier) {
        return FilterBuilder.map(new PercentDelta()::value, arg(supplier));
    }

    public static  Wrapper percentChange(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new PercentDelta()::value,  arg(wrapper, supplier));
    }

    public static  Wrapper percentChange(Wrapper wrapper) {
        return FilterBuilder.map(new PercentDelta()::value,  arg(wrapper));
    }

    /**
     * Wrap {@link Delta#value } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Delta#value }
     * @return {@link SerializableFunction} of {@link Delta#value }
     */
    public static  SerializableFunction delta() {
        return new Delta()::value;
    }

    /**
     * Performs a {@link Delta#value} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Delta#value
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Delta#value}
     */
    public static  Wrapper delta(SerializableFunction supplier) {
        return FilterBuilder.map(new Delta()::value, arg(supplier));
    }

    public static  Wrapper delta(FunctionArg arg) {
        return FilterBuilder.map(new Delta()::value, arg);
    }

    /**
     * Performs a {@link Delta#value} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Delta#value}
     * @param supplier The wrapped instance supplying values to the function {@link Delta#value
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Delta#value}
     */
    public static  Wrapper delta(SerializableSupplier supplier) {
        return FilterBuilder.map(new Delta()::value, arg(supplier));
    }

    public static  Wrapper delta(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(new Delta()::value,  arg(wrapper, supplier));
    }

    public static  Wrapper delta(Wrapper wrapper) {
        return FilterBuilder.map(new Delta()::value,  arg(wrapper));
    }

    /**
     * Wrap {@link StreamFunctions#asDouble } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link StreamFunctions#asDouble }
     * @return {@link SerializableFunction} of {@link StreamFunctions#asDouble }
     */
    public static  SerializableFunction toDouble() {
        return StreamFunctions::asDouble;
    }

    /**
     * Performs a {@link StreamFunctions#asDouble} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link StreamFunctions#asDouble
     * @return {@link  Wrapper<Number>} wrapping the result of {@link StreamFunctions#asDouble}
     */
    public static  Wrapper toDouble(SerializableFunction supplier) {
        return FilterBuilder.map(StreamFunctions::asDouble, arg(supplier));
    }

    public static  Wrapper toDouble(FunctionArg arg) {
        return FilterBuilder.map(StreamFunctions::asDouble, arg);
    }

    /**
     * Performs a {@link StreamFunctions#asDouble} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link StreamFunctions#asDouble}
     * @param supplier The wrapped instance supplying values to the function {@link StreamFunctions#asDouble
     * @return {@link  Wrapper<Number>} wrapping the result of {@link StreamFunctions#asDouble}
     */
    public static  Wrapper toDouble(SerializableSupplier supplier) {
        return FilterBuilder.map(StreamFunctions::asDouble, arg(supplier));
    }

    public static  Wrapper toDouble(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(StreamFunctions::asDouble,  arg(wrapper, supplier));
    }

    public static  Wrapper toDouble(Wrapper wrapper) {
        return FilterBuilder.map(StreamFunctions::asDouble,  arg(wrapper));
    }

    /**
     * Wrap {@link Math#ceil } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Math#ceil }
     * @return {@link SerializableFunction} of {@link Math#ceil }
     */
    public static  SerializableFunction ceil() {
        return Math::ceil;
    }

    /**
     * Performs a {@link Math#ceil} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Math#ceil
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Math#ceil}
     */
    public static  Wrapper ceil(SerializableFunction supplier) {
        return FilterBuilder.map(Math::ceil, arg(supplier));
    }

    public static  Wrapper ceil(FunctionArg arg) {
        return FilterBuilder.map(Math::ceil, arg);
    }

    /**
     * Performs a {@link Math#ceil} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Math#ceil}
     * @param supplier The wrapped instance supplying values to the function {@link Math#ceil
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Math#ceil}
     */
    public static  Wrapper ceil(SerializableSupplier supplier) {
        return FilterBuilder.map(Math::ceil, arg(supplier));
    }

    public static  Wrapper ceil(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(Math::ceil,  arg(wrapper, supplier));
    }

    public static  Wrapper ceil(Wrapper wrapper) {
        return FilterBuilder.map(Math::ceil,  arg(wrapper));
    }

    /**
     * Wrap {@link Math#floor } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Math#floor }
     * @return {@link SerializableFunction} of {@link Math#floor }
     */
    public static  SerializableFunction floor() {
        return Math::floor;
    }

    /**
     * Performs a {@link Math#floor} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<Number>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @param supplier The input value to the function {@link Math#floor
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Math#floor}
     */
    public static  Wrapper floor(SerializableFunction supplier) {
        return FilterBuilder.map(Math::floor, arg(supplier));
    }

    public static  Wrapper floor(FunctionArg arg) {
        return FilterBuilder.map(Math::floor, arg);
    }

    /**
     * Performs a {@link Math#floor} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<Number>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Math#floor}
     * @param supplier The wrapped instance supplying values to the function {@link Math#floor
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Math#floor}
     */
    public static  Wrapper floor(SerializableSupplier supplier) {
        return FilterBuilder.map(Math::floor, arg(supplier));
    }

    public static  Wrapper floor(Wrapper wrapper, SerializableFunction supplier) {
        return FilterBuilder.map(Math::floor,  arg(wrapper, supplier));
    }

    public static  Wrapper floor(Wrapper wrapper) {
        return FilterBuilder.map(Math::floor,  arg(wrapper));
    }


    /**
     * Wrap {@link Count#increment } function for use as a map operation in an existing
     * stream. {@link Wrapper#map(SerializableFunction) }
     * requires a {@link SerializableFunction} to map input values.
     *
     * @param  input to {@link Count#increment }
     * @return {@link SerializableFunction} of {@link Count#increment }
     */
    public static  SerializableFunction count() {
        return new Count()::increment;
    }

    /**
     * Performs a {@link Count#increment} function as a map operation on a stream.
     * The stream is automatically created by subscribing to the {@link Event}
     * and wrapping the supplier function with {@link Wrapper<T>}. 
     * The wrapper is the input to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input event stream
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Count#increment}
     */
    public static  Wrapper count(Class eventClass) {
        return select(eventClass).map(new Count()::increment);
    }

    /**
     * Performs a {@link Count#increment} function as a map operation on a stream.
     * The stream is automatically created by wrapping the supplier instance function in a
     * {@link Wrapper<T>}, the wrapper is the input 
     * to the mapping function. The mapped value is available as
     * a {@link Wrapper<Number>} instance for further stream operations.
     *
     * @param  The input type required by {@link Count#increment}
     * @param supplier The wrapped instance supplying values to the function {@link Count#increment
     * @return {@link  Wrapper<Number>} wrapping the result of {@link Count#increment}
     */
    public static  Wrapper count(T supplier) {
        return stream(supplier).map(new Count()::increment);
    }


}