public class FunctionUtils extends Object
Set of static methods allowing to ease the manipulation of functions applications.
This particular class aims at allowing the application of functions on combinations of parameter values by looping over all values and producing the result. Since the result is to be used for Approval Testing, the applied functions will return String values.
| Constructor and Description |
|---|
FunctionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <IN1> String |
applyCombinations(Iterable<IN1> args1,
Function1<IN1,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
|
static <IN1,IN2> String |
applyCombinations(Iterable<IN1> args1,
Iterable<IN2> args2,
Function2<IN1,IN2,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
|
static <IN1,IN2,IN3> |
applyCombinations(Iterable<IN1> args1,
Iterable<IN2> args2,
Iterable<IN3> args3,
Function3<IN1,IN2,IN3,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
|
static <IN1,IN2,IN3,IN4> |
applyCombinations(Iterable<IN1> args1,
Iterable<IN2> args2,
Iterable<IN3> args3,
Iterable<IN4> args4,
Function4<IN1,IN2,IN3,IN4,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
|
static <IN1,IN2,IN3,IN4,IN5> |
applyCombinations(Iterable<IN1> args1,
Iterable<IN2> args2,
Iterable<IN3> args3,
Iterable<IN4> args4,
Iterable<IN5> args5,
Function5<IN1,IN2,IN3,IN4,IN5,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
|
public static <IN1> String applyCombinations(Iterable<IN1> args1, Function1<IN1,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
The produced String will contain both the provided arguments and the computed value, and can later be used for writting the approvals files.
args1 - A collection of all the arguments 1 to apply the function tofunction - The function to apply on the combinations of provided argumentsIN1 - Type of the argument 1public static <IN1,IN2> String applyCombinations(Iterable<IN1> args1, Iterable<IN2> args2, Function2<IN1,IN2,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
The produced String will contain both the provided arguments and the computed value, and can later be used for writting the approvals files.
args1 - A collection of all the arguments 1 to apply the function toargs2 - A collection of all the arguments 2 to apply the function tofunction - The function to apply on the combinations of provided argumentsIN1 - Type of the argument 1IN2 - Type of the argument 2public static <IN1,IN2,IN3> String applyCombinations(Iterable<IN1> args1, Iterable<IN2> args2, Iterable<IN3> args3, Function3<IN1,IN2,IN3,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
The produced String will contain both the provided arguments and the computed value, and can later be used for writting the approvals files.
args1 - A collection of all the arguments 1 to apply the function toargs2 - A collection of all the arguments 2 to apply the function toargs3 - A collection of all the arguments 3 to apply the function tofunction - The function to apply on the combinations of provided argumentsIN1 - Type of the argument 1IN2 - Type of the argument 2IN3 - Type of the argument 3public static <IN1,IN2,IN3,IN4> String applyCombinations(Iterable<IN1> args1, Iterable<IN2> args2, Iterable<IN3> args3, Iterable<IN4> args4, Function4<IN1,IN2,IN3,IN4,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
The produced String will contain both the provided arguments and the computed value, and can later be used for writting the approvals files.
args1 - A collection of all the arguments 1 to apply the function toargs2 - A collection of all the arguments 2 to apply the function toargs3 - A collection of all the arguments 3 to apply the function toargs4 - A collection of all the arguments 4 to apply the function tofunction - The function to apply on the combinations of provided argumentsIN1 - Type of the argument 1IN2 - Type of the argument 2IN3 - Type of the argument 3IN4 - Type of the argument 4public static <IN1,IN2,IN3,IN4,IN5> String applyCombinations(Iterable<IN1> args1, Iterable<IN2> args2, Iterable<IN3> args3, Iterable<IN4> args4, Iterable<IN5> args5, Function5<IN1,IN2,IN3,IN4,IN5,?> function)
Applies the provided function to all combinations of all the provided arguments for the function, and returns the produced results as a String.
The produced String will contain both the provided arguments and the computed value, and can later be used for writting the approvals files.
args1 - A collection of all the arguments 1 to apply the function toargs2 - A collection of all the arguments 2 to apply the function toargs3 - A collection of all the arguments 3 to apply the function toargs4 - A collection of all the arguments 4 to apply the function toargs5 - A collection of all the arguments 5 to apply the function tofunction - The function to apply on the combinations of provided argumentsIN1 - Type of the argument 1IN2 - Type of the argument 2IN3 - Type of the argument 3IN4 - Type of the argument 4IN5 - Type of the argument 5Copyright © 2018–2019 Write Them First!. All rights reserved.