Module life.expert

Class TupleUtils


  • public class TupleUtils
    extends java.lang.Object
      Hepler 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 a Consumer of Tuple2 that wraps a consumer of the component values of the tuple
      static <T1> java.util.function.Consumer<io.vavr.Tuple1<T1>> consumer​(java.util.function.Consumer<T1> consumer)
      Returns a Consumer of Tuple1 that wraps a consumer of the component values of the tuple
      static <T1,​T2,​T3>
      java.util.function.Consumer<io.vavr.Tuple3<T1,​T2,​T3>>
      consumer​(reactor.function.Consumer3<T1,​T2,​T3> consumer)
      Returns a Consumer of Tuple3 that wraps a consumer of the component values of the tuple
      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 a Consumer of Tuple4 that wraps a consumer of the component values of the tuple
      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 a Consumer of Tuple5 that wraps a consumer of the component values of the tuple
      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 a Consumer of Tuple6 that wraps a consumer of the component values of the tuple
      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 a Consumer of Tuple7 that wraps a consumer of the component values of the tuple
      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 a Consumer of Tuple8 that wraps a consumer of the component values of the tuple
      static <T1,​T2,​R>
      java.util.function.Function<io.vavr.Tuple2<T1,​T2>,​R>
      function​(java.util.function.BiFunction<T1,​T2,​R> function)
      Returns a Function of Tuple2 that wraps a function of the component values of the tuple
      static <T1,​R>
      java.util.function.Function<io.vavr.Tuple1<T1>,​R>
      function​(java.util.function.Function<T1,​R> function)
      Returns a Function of Tuple1 that wraps a function of the component values of the tuple
      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 a Function of Tuple3 that wraps a function of the component values of the tuple
      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 a Function of Tuple4 that wraps a function of the component values of the tuple
      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 a Function of Tuple5 that wraps a function of the component values of the tuple
      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 a Function of Tuple6 that wraps a function of the component values of the tuple
      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 a Function of Tuple7 that wraps a function of the component values of the tuple
      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 a Function of Tuple8 that wraps a function of the component values of the tuple
      static <T1,​T2>
      java.util.function.Predicate<io.vavr.Tuple2<T1,​T2>>
      predicate​(java.util.function.BiPredicate<T1,​T2> predicate)
      Returns a Predicate of Tuple2 that wraps a predicate of the component values of the tuple
      static <T1> java.util.function.Predicate<io.vavr.Tuple1<T1>> predicate​(java.util.function.Predicate<T1> predicate)
      Returns a Predicate of Tuple1 that wraps a predicate of the component values of the tuple
      static <T1,​T2,​T3>
      java.util.function.Predicate<io.vavr.Tuple3<T1,​T2,​T3>>
      predicate​(reactor.function.Predicate3<T1,​T2,​T3> predicate)
      Returns a Predicate of Tuple3 that wraps a predicate of the component values of the tuple
      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 a Predicate of Tuple4 that wraps a predicate of the component values of the tuple
      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 a Predicate of Tuple5 that wraps a predicate of the component values of the tuple
      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 a Predicate of Tuple6 that wraps a predicate of the component values of the tuple
      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 a Predicate of Tuple7 that wraps a predicate of the component values of the tuple
      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 a Predicate of Tuple8 that wraps a predicate of the component values of the tuple
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TupleUtils

        public TupleUtils()
    • Method Detail

      • consumer

        public static <T1> java.util.function.Consumer<io.vavr.Tuple1<T1>> consumer​(java.util.function.Consumer<T1> consumer)
        Returns a Consumer of Tuple1 that 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 a Consumer of Tuple2 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - 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 a Consumer of Tuple3 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - 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 a Consumer of Tuple4 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - 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 a Consumer of Tuple5 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - 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 a Consumer of Tuple6 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - 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 a Consumer of Tuple7 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - 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 a Consumer of Tuple8 that wraps a consumer of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - the type of the seventh value
        T8 - 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 a Function of Tuple1 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        R - 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 a Function of Tuple2 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        R - 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 a Function of Tuple3 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        R - 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 a Function of Tuple4 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        R - 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 a Function of Tuple5 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        R - 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 a Function of Tuple6 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        R - 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 a Function of Tuple7 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - the type of the seventh value
        R - 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 a Function of Tuple8 that wraps a function of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - the type of the seventh value
        T8 - the type of the eighth value
        R - 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 a Predicate of Tuple1 that 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 a Predicate of Tuple2 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - 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 a Predicate of Tuple3 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - 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 a Predicate of Tuple4 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - 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 a Predicate of Tuple5 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - 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 a Predicate of Tuple6 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - 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 a Predicate of Tuple7 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - 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 a Predicate of Tuple8 that wraps a predicate of the component values of the tuple
        Type Parameters:
        T1 - the type of the first value
        T2 - the type of the second value
        T3 - the type of the third value
        T4 - the type of the fourth value
        T5 - the type of the fifth value
        T6 - the type of the sixth value
        T7 - the type of the seventh value
        T8 - the type of the eighth value
        Parameters:
        predicate - the component value predicate
        Returns:
        the wrapper predicate