- java.lang.Object
-
- life.expert.common.function.TupleUtils
-
public class TupleUtils extends java.lang.ObjectHepler functions for conversions Vavr's tuple-result into (a,b..)-result Utils is insired by TupleUtils from io.projectreactor.addons:reactor-extra Unlike the library, they allow you to contain null values, which allows you to take input values of methods and check them later with the Flux.error event (not raise exception as in reactor-extra ) Preconditions: none Postconditions: none Side effects: none Tread safety: Immutable
-
-
Constructor Summary
Constructors Constructor Description TupleUtils()
-
Method Summary
Modifier and Type Method Description static <T1,T2>
java.util.function.Consumer<io.vavr.Tuple2<T1,T2>>consumer(java.util.function.BiConsumer<T1,T2> consumer)Returns aConsumerofTuple2that wraps a consumer of the component values of the tuplestatic <T1> java.util.function.Consumer<io.vavr.Tuple1<T1>>consumer(java.util.function.Consumer<T1> consumer)Returns aConsumerofTuple1that wraps a consumer of the component values of the tuplestatic <T1,T2,T3>
java.util.function.Consumer<io.vavr.Tuple3<T1,T2,T3>>consumer(reactor.function.Consumer3<T1,T2,T3> consumer)Returns aConsumerofTuple3that wraps a consumer of the component values of the tuplestatic <T1,T2,T3,T4>
java.util.function.Consumer<io.vavr.Tuple4<T1,T2,T3,T4>>consumer(reactor.function.Consumer4<T1,T2,T3,T4> consumer)Returns aConsumerofTuple4that wraps a consumer of the component values of the tuplestatic <T1,T2,T3,T4,T5>
java.util.function.Consumer<io.vavr.Tuple5<T1,T2,T3,T4,T5>>consumer(reactor.function.Consumer5<T1,T2,T3,T4,T5> consumer)Returns aConsumerofTuple5that wraps a consumer of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6>
java.util.function.Consumer<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>>consumer(reactor.function.Consumer6<T1,T2,T3,T4,T5,T6> consumer)Returns aConsumerofTuple6that wraps a consumer of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7>
java.util.function.Consumer<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>>consumer(reactor.function.Consumer7<T1,T2,T3,T4,T5,T6,T7> consumer)Returns aConsumerofTuple7that wraps a consumer of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7,T8>
java.util.function.Consumer<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>>consumer(reactor.function.Consumer8<T1,T2,T3,T4,T5,T6,T7,T8> consumer)Returns aConsumerofTuple8that wraps a consumer of the component values of the tuplestatic <T1,T2,R>
java.util.function.Function<io.vavr.Tuple2<T1,T2>,R>function(java.util.function.BiFunction<T1,T2,R> function)Returns aFunctionofTuple2that wraps a function of the component values of the tuplestatic <T1,R>
java.util.function.Function<io.vavr.Tuple1<T1>,R>function(java.util.function.Function<T1,R> function)Returns aFunctionofTuple1that wraps a function of the component values of the tuplestatic <T1,T2,T3,R>
java.util.function.Function<io.vavr.Tuple3<T1,T2,T3>,R>function(reactor.function.Function3<T1,T2,T3,R> function)Returns aFunctionofTuple3that wraps a function of the component values of the tuplestatic <T1,T2,T3,T4,R>
java.util.function.Function<io.vavr.Tuple4<T1,T2,T3,T4>,R>function(reactor.function.Function4<T1,T2,T3,T4,R> function)Returns aFunctionofTuple4that wraps a function of the component values of the tuplestatic <T1,T2,T3,T4,T5,R>
java.util.function.Function<io.vavr.Tuple5<T1,T2,T3,T4,T5>,R>function(reactor.function.Function5<T1,T2,T3,T4,T5,R> function)Returns aFunctionofTuple5that wraps a function of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,R>
java.util.function.Function<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>,R>function(reactor.function.Function6<T1,T2,T3,T4,T5,T6,R> function)Returns aFunctionofTuple6that wraps a function of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7,R>
java.util.function.Function<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>,R>function(reactor.function.Function7<T1,T2,T3,T4,T5,T6,T7,R> function)Returns aFunctionofTuple7that wraps a function of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7,T8,R>
java.util.function.Function<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>,R>function(reactor.function.Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> function)Returns aFunctionofTuple8that wraps a function of the component values of the tuplestatic <T1,T2>
java.util.function.Predicate<io.vavr.Tuple2<T1,T2>>predicate(java.util.function.BiPredicate<T1,T2> predicate)Returns aPredicateofTuple2that wraps a predicate of the component values of the tuplestatic <T1> java.util.function.Predicate<io.vavr.Tuple1<T1>>predicate(java.util.function.Predicate<T1> predicate)Returns aPredicateofTuple1that wraps a predicate of the component values of the tuplestatic <T1,T2,T3>
java.util.function.Predicate<io.vavr.Tuple3<T1,T2,T3>>predicate(reactor.function.Predicate3<T1,T2,T3> predicate)Returns aPredicateofTuple3that wraps a predicate of the component values of the tuplestatic <T1,T2,T3,T4>
java.util.function.Predicate<io.vavr.Tuple4<T1,T2,T3,T4>>predicate(reactor.function.Predicate4<T1,T2,T3,T4> predicate)Returns aPredicateofTuple4that wraps a predicate of the component values of the tuplestatic <T1,T2,T3,T4,T5>
java.util.function.Predicate<io.vavr.Tuple5<T1,T2,T3,T4,T5>>predicate(reactor.function.Predicate5<T1,T2,T3,T4,T5> predicate)Returns aPredicateofTuple5that wraps a predicate of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6>
java.util.function.Predicate<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>>predicate(reactor.function.Predicate6<T1,T2,T3,T4,T5,T6> predicate)Returns aPredicateofTuple6that wraps a predicate of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7>
java.util.function.Predicate<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>>predicate(reactor.function.Predicate7<T1,T2,T3,T4,T5,T6,T7> predicate)Returns aPredicateofTuple7that wraps a predicate of the component values of the tuplestatic <T1,T2,T3,T4,T5,T6,T7,T8>
java.util.function.Predicate<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>>predicate(reactor.function.Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> predicate)Returns aPredicateofTuple8that wraps a predicate of the component values of the tuple
-
-
-
Method Detail
-
consumer
public static <T1> java.util.function.Consumer<io.vavr.Tuple1<T1>> consumer(java.util.function.Consumer<T1> consumer)
Returns aConsumerofTuple1that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2> java.util.function.Consumer<io.vavr.Tuple2<T1,T2>> consumer(java.util.function.BiConsumer<T1,T2> consumer)
Returns aConsumerofTuple2that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3> java.util.function.Consumer<io.vavr.Tuple3<T1,T2,T3>> consumer(reactor.function.Consumer3<T1,T2,T3> consumer)
Returns aConsumerofTuple3that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3,T4> java.util.function.Consumer<io.vavr.Tuple4<T1,T2,T3,T4>> consumer(reactor.function.Consumer4<T1,T2,T3,T4> consumer)
Returns aConsumerofTuple4that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3,T4,T5> java.util.function.Consumer<io.vavr.Tuple5<T1,T2,T3,T4,T5>> consumer(reactor.function.Consumer5<T1,T2,T3,T4,T5> consumer)
Returns aConsumerofTuple5that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3,T4,T5,T6> java.util.function.Consumer<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>> consumer(reactor.function.Consumer6<T1,T2,T3,T4,T5,T6> consumer)
Returns aConsumerofTuple6that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3,T4,T5,T6,T7> java.util.function.Consumer<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>> consumer(reactor.function.Consumer7<T1,T2,T3,T4,T5,T6,T7> consumer)
Returns aConsumerofTuple7that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
consumer
public static <T1,T2,T3,T4,T5,T6,T7,T8> java.util.function.Consumer<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>> consumer(reactor.function.Consumer8<T1,T2,T3,T4,T5,T6,T7,T8> consumer)
Returns aConsumerofTuple8that wraps a consumer of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh valueT8- the type of the eighth value- Parameters:
consumer- the component value consumer- Returns:
- the wrapper consumer
-
function
public static <T1,R> java.util.function.Function<io.vavr.Tuple1<T1>,R> function(java.util.function.Function<T1,R> function)
Returns aFunctionofTuple1that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,R> java.util.function.Function<io.vavr.Tuple2<T1,T2>,R> function(java.util.function.BiFunction<T1,T2,R> function)
Returns aFunctionofTuple2that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,R> java.util.function.Function<io.vavr.Tuple3<T1,T2,T3>,R> function(reactor.function.Function3<T1,T2,T3,R> function)
Returns aFunctionofTuple3that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,T4,R> java.util.function.Function<io.vavr.Tuple4<T1,T2,T3,T4>,R> function(reactor.function.Function4<T1,T2,T3,T4,R> function)
Returns aFunctionofTuple4that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,T4,T5,R> java.util.function.Function<io.vavr.Tuple5<T1,T2,T3,T4,T5>,R> function(reactor.function.Function5<T1,T2,T3,T4,T5,R> function)
Returns aFunctionofTuple5that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,T4,T5,T6,R> java.util.function.Function<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>,R> function(reactor.function.Function6<T1,T2,T3,T4,T5,T6,R> function)
Returns aFunctionofTuple6that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,T4,T5,T6,T7,R> java.util.function.Function<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>,R> function(reactor.function.Function7<T1,T2,T3,T4,T5,T6,T7,R> function)
Returns aFunctionofTuple7that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
function
public static <T1,T2,T3,T4,T5,T6,T7,T8,R> java.util.function.Function<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>,R> function(reactor.function.Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> function)
Returns aFunctionofTuple8that wraps a function of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh valueT8- the type of the eighth valueR- the type of the result of the function- Parameters:
function- the component value function- Returns:
- the wrapper function
-
predicate
public static <T1> java.util.function.Predicate<io.vavr.Tuple1<T1>> predicate(java.util.function.Predicate<T1> predicate)
Returns aPredicateofTuple1that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2> java.util.function.Predicate<io.vavr.Tuple2<T1,T2>> predicate(java.util.function.BiPredicate<T1,T2> predicate)
Returns aPredicateofTuple2that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3> java.util.function.Predicate<io.vavr.Tuple3<T1,T2,T3>> predicate(reactor.function.Predicate3<T1,T2,T3> predicate)
Returns aPredicateofTuple3that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3,T4> java.util.function.Predicate<io.vavr.Tuple4<T1,T2,T3,T4>> predicate(reactor.function.Predicate4<T1,T2,T3,T4> predicate)
Returns aPredicateofTuple4that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3,T4,T5> java.util.function.Predicate<io.vavr.Tuple5<T1,T2,T3,T4,T5>> predicate(reactor.function.Predicate5<T1,T2,T3,T4,T5> predicate)
Returns aPredicateofTuple5that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3,T4,T5,T6> java.util.function.Predicate<io.vavr.Tuple6<T1,T2,T3,T4,T5,T6>> predicate(reactor.function.Predicate6<T1,T2,T3,T4,T5,T6> predicate)
Returns aPredicateofTuple6that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3,T4,T5,T6,T7> java.util.function.Predicate<io.vavr.Tuple7<T1,T2,T3,T4,T5,T6,T7>> predicate(reactor.function.Predicate7<T1,T2,T3,T4,T5,T6,T7> predicate)
Returns aPredicateofTuple7that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
predicate
public static <T1,T2,T3,T4,T5,T6,T7,T8> java.util.function.Predicate<io.vavr.Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>> predicate(reactor.function.Predicate8<T1,T2,T3,T4,T5,T6,T7,T8> predicate)
Returns aPredicateofTuple8that wraps a predicate of the component values of the tuple- Type Parameters:
T1- the type of the first valueT2- the type of the second valueT3- the type of the third valueT4- the type of the fourth valueT5- the type of the fifth valueT6- the type of the sixth valueT7- the type of the seventh valueT8- the type of the eighth value- Parameters:
predicate- the component value predicate- Returns:
- the wrapper predicate
-
-