Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.factory;
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.api.stream.Argument;
import com.fluxtion.ext.streaming.builder.util.StreamFunctionGenerator;
import static com.fluxtion.ext.streaming.builder.factory.EventSelect.*;
import static com.fluxtion.ext.streaming.builder.factory.MappingBuilder.*;
import static com.fluxtion.ext.streaming.builder.stream.StreamOperatorService.*;
import static com.fluxtion.ext.streaming.api.stream.Argument.*;
/**
* 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 LibraryFunctionsBuilder {
public static SerializableBiFunction add() {
return StreamFunctions::add;
}
public static Wrapper add(SerializableFunction supplier1, SerializableFunction supplier2) {
return map(add(), arg(supplier1), arg(supplier2));
}
public static Wrapper add(SerializableSupplier supplier1, SerializableSupplier supplier2) {
return map(add(), arg(supplier1), arg(supplier2));
}
public static Wrapper add(Argument arg1, Argument arg2) {
return map(add(), arg1, arg2);
}
public static Wrapper add(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
return map(add(), arg(wrapper, supplier1), arg(wrapper, supplier2));
}
public static Wrapper add(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
return map(add(), arg(wrapper1, supplier1), arg(wrapper2, supplier2));
}
public static Wrapper add(Wrapper wrapper1, Wrapper wrapper2) {
return map(add(), arg(wrapper1), arg(wrapper2));
}
public static SerializableBiFunction subtract() {
return StreamFunctions::subtract;
}
public static Wrapper subtract(SerializableFunction supplier1, SerializableFunction supplier2) {
return map(subtract(), arg(supplier1), arg(supplier2));
}
public static Wrapper subtract(SerializableSupplier supplier1, SerializableSupplier supplier2) {
return map(subtract(), arg(supplier1), arg(supplier2));
}
public static Wrapper subtract(Argument arg1, Argument arg2) {
return map(subtract(), arg1, arg2);
}
public static Wrapper subtract(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
return map(subtract(), arg(wrapper, supplier1), arg(wrapper, supplier2));
}
public static Wrapper subtract(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
return map(subtract(), arg(wrapper1, supplier1), arg(wrapper2, supplier2));
}
public static Wrapper subtract(Wrapper wrapper1, Wrapper wrapper2) {
return map(subtract(), arg(wrapper1), arg(wrapper2));
}
public static SerializableBiFunction multiply() {
return StreamFunctions::multiply;
}
public static Wrapper multiply(SerializableFunction supplier1, SerializableFunction supplier2) {
return map(multiply(), arg(supplier1), arg(supplier2));
}
public static Wrapper multiply(SerializableSupplier supplier1, SerializableSupplier supplier2) {
return map(multiply(), arg(supplier1), arg(supplier2));
}
public static Wrapper multiply(Argument arg1, Argument arg2) {
return map(multiply(), arg1, arg2);
}
public static Wrapper multiply(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
return map(multiply(), arg(wrapper, supplier1), arg(wrapper, supplier2));
}
public static Wrapper multiply(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
return map(multiply(), arg(wrapper1, supplier1), arg(wrapper2, supplier2));
}
public static Wrapper multiply(Wrapper wrapper1, Wrapper wrapper2) {
return map(multiply(), arg(wrapper1), arg(wrapper2));
}
public static SerializableBiFunction divide() {
return StreamFunctions::divide;
}
public static Wrapper divide(SerializableFunction supplier1, SerializableFunction supplier2) {
return map(divide(), arg(supplier1), arg(supplier2));
}
public static Wrapper divide(SerializableSupplier supplier1, SerializableSupplier supplier2) {
return map(divide(), arg(supplier1), arg(supplier2));
}
public static Wrapper divide(Argument arg1, Argument arg2) {
return map(divide(), arg1, arg2);
}
public static Wrapper divide(Wrapper wrapper, SerializableFunction supplier1, SerializableFunction supplier2) {
return map(divide(), arg(wrapper, supplier1), arg(wrapper, supplier2));
}
public static Wrapper divide(Wrapper wrapper1, SerializableFunction supplier1, Wrapper wrapper2, SerializableFunction supplier2) {
return map(divide(), arg(wrapper1, supplier1), arg(wrapper2, supplier2));
}
public static Wrapper divide(Wrapper wrapper1, Wrapper wrapper2) {
return map(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 map(cumSum(), arg(supplier));
}
public static Wrapper cumSum(Argument arg) {
return map(cumSum(), 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 map(cumSum(), arg(supplier));
}
public static Wrapper cumSum(Wrapper wrapper, SerializableFunction supplier) {
return map(cumSum(), arg(wrapper, supplier));
}
public static Wrapper cumSum(Wrapper wrapper) {
return map(cumSum(), 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 map(avg(), arg(supplier));
}
public static Wrapper avg(Argument arg) {
return map(avg(), 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 map(avg(), arg(supplier));
}
public static Wrapper avg(Wrapper wrapper, SerializableFunction supplier) {
return map(avg(), arg(wrapper, supplier));
}
public static Wrapper avg(Wrapper wrapper) {
return map(avg(), 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 map(max(), arg(supplier));
}
public static Wrapper max(Argument arg) {
return map(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 map(max(), arg(supplier));
}
public static Wrapper max(Wrapper wrapper, SerializableFunction supplier) {
return map(max(), arg(wrapper, supplier));
}
public static Wrapper max(Wrapper wrapper) {
return map(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 map(min(), arg(supplier));
}
public static Wrapper min(Argument arg) {
return map(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 map(min(), arg(supplier));
}
public static Wrapper min(Wrapper wrapper, SerializableFunction supplier) {
return map(min(), arg(wrapper, supplier));
}
public static Wrapper min(Wrapper wrapper) {
return map(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 map(percentChange(), arg(supplier));
}
public static Wrapper percentChange(Argument arg) {
return map(percentChange(), 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 map(percentChange(), arg(supplier));
}
public static Wrapper percentChange(Wrapper wrapper, SerializableFunction supplier) {
return map(percentChange(), arg(wrapper, supplier));
}
public static Wrapper percentChange(Wrapper wrapper) {
return map(percentChange(), 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 map(delta(), arg(supplier));
}
public static Wrapper delta(Argument arg) {
return map(delta(), 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 map(delta(), arg(supplier));
}
public static Wrapper delta(Wrapper wrapper, SerializableFunction supplier) {
return map(delta(), arg(wrapper, supplier));
}
public static Wrapper delta(Wrapper wrapper) {
return map(delta(), 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 map(toDouble(), arg(supplier));
}
public static