Class UniZip


  • public class UniZip
    extends java.lang.Object
    Combines several Uni into a new Uni that will fire an item event when all Uni are resolved successfully aggregating their results (emitted item) into a Tuple, or using a combinator function.

    The produced Uni fire a failure if one of Unis produces a failure. This will cause the other Uni to be cancelled, expect if collectFailures() is invoked, which delay firing the failure until all Unis have completed or failed.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <O> UniAndGroupIterable<O> unis​(Uni<?>... unis)
      Combines several unis together.
      <T1,​T2>
      UniAndGroup2<T1,​T2>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2)
      Combines two unis together.
      <T1,​T2,​T3>
      UniAndGroup3<T1,​T2,​T3>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3)
      Combines the three unis together.
      <T1,​T2,​T3,​T4>
      UniAndGroup4<T1,​T2,​T3,​T4>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4)
      Combines four unis together.
      <T1,​T2,​T3,​T4,​T5>
      UniAndGroup5<T1,​T2,​T3,​T4,​T5>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4, Uni<? extends T5> u5)
      Combines five unis together.
      <T1,​T2,​T3,​T4,​T5,​T6>
      UniAndGroup6<T1,​T2,​T3,​T4,​T5,​T6>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4, Uni<? extends T5> u5, Uni<? extends T6> u6)
      Combines six unis together.
      <T1,​T2,​T3,​T4,​T5,​T6,​T7>
      UniAndGroup7<T1,​T2,​T3,​T4,​T5,​T6,​T7>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4, Uni<? extends T5> u5, Uni<? extends T6> u6, Uni<? extends T7> u7)
      Combines 7 unis together.
      <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8>
      UniAndGroup8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4, Uni<? extends T5> u5, Uni<? extends T6> u6, Uni<? extends T7> u7, Uni<? extends T8> u8)
      Combines 8 unis together.
      <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9>
      UniAndGroup9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9>
      unis​(Uni<? extends T1> u1, Uni<? extends T2> u2, Uni<? extends T3> u3, Uni<? extends T4> u4, Uni<? extends T5> u5, Uni<? extends T6> u6, Uni<? extends T7> u7, Uni<? extends T8> u8, Uni<? extends T9> u9)
      Combines 9 unis together.
      <O> UniAndGroupIterable<O> unis​(java.lang.Iterable<? extends Uni<?>> unis)
      Combines several unis together.
      • Methods inherited from class java.lang.Object

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

      • unis

        @CheckReturnValue
        public <T1,​T2> UniAndGroup2<T1,​T2> unis​(Uni<? extends T1> u1,
                                                            Uni<? extends T2> u2)
        Combines two unis together. Once both Uni have completed successfully, the item can be retrieved as a Tuple2 or computed using a BiFunction.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup2.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        Parameters:
        u1 - the first uni, must not be null
        u2 - the second uni, must not be null
        Returns:
        an UniAndGroup2 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3> UniAndGroup3<T1,​T2,​T3> unis​(Uni<? extends T1> u1,
                                                                              Uni<? extends T2> u2,
                                                                              Uni<? extends T3> u3)
        Combines the three unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple3 or computed using a Functions.Function3.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup3.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        Returns:
        an UniAndGroup3 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4> UniAndGroup4<T1,​T2,​T3,​T4> unis​(Uni<? extends T1> u1,
                                                                                                Uni<? extends T2> u2,
                                                                                                Uni<? extends T3> u3,
                                                                                                Uni<? extends T4> u4)
        Combines four unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple4 or computed using a Functions.Function4.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup4.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        Returns:
        an UniAndGroup4 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4,​T5> UniAndGroup5<T1,​T2,​T3,​T4,​T5> unis​(Uni<? extends T1> u1,
                                                                                                                  Uni<? extends T2> u2,
                                                                                                                  Uni<? extends T3> u3,
                                                                                                                  Uni<? extends T4> u4,
                                                                                                                  Uni<? extends T5> u5)
        Combines five unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple5 or computed using a Functions.Function5.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup5.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        T5 - the type of the item for the fifth uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        u5 - the fifth uni to be combined, must not be null
        Returns:
        an UniAndGroup5 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4,​T5,​T6> UniAndGroup6<T1,​T2,​T3,​T4,​T5,​T6> unis​(Uni<? extends T1> u1,
                                                                                                                                    Uni<? extends T2> u2,
                                                                                                                                    Uni<? extends T3> u3,
                                                                                                                                    Uni<? extends T4> u4,
                                                                                                                                    Uni<? extends T5> u5,
                                                                                                                                    Uni<? extends T6> u6)
        Combines six unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple6 or computed using a Functions.Function6.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup6.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        T5 - the type of the item for the fifth uni
        T6 - the type of the item for the sixth uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        u5 - the fifth uni to be combined, must not be null
        u6 - the sixth uni to be combined, must not be null
        Returns:
        an UniAndGroup6 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4,​T5,​T6,​T7> UniAndGroup7<T1,​T2,​T3,​T4,​T5,​T6,​T7> unis​(Uni<? extends T1> u1,
                                                                                                                                                      Uni<? extends T2> u2,
                                                                                                                                                      Uni<? extends T3> u3,
                                                                                                                                                      Uni<? extends T4> u4,
                                                                                                                                                      Uni<? extends T5> u5,
                                                                                                                                                      Uni<? extends T6> u6,
                                                                                                                                                      Uni<? extends T7> u7)
        Combines 7 unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple7 or computed using a Functions.Function8.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup7.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        T5 - the type of the item for the fifth uni
        T6 - the type of the item for the sixth uni
        T7 - the type of the item for the seventh uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        u5 - the fifth uni to be combined, must not be null
        u6 - the sixth uni to be combined, must not be null
        u7 - the seventh uni to be combined, must not be null
        Returns:
        an UniAndGroup7 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8> UniAndGroup8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8> unis​(Uni<? extends T1> u1,
                                                                                                                                                                        Uni<? extends T2> u2,
                                                                                                                                                                        Uni<? extends T3> u3,
                                                                                                                                                                        Uni<? extends T4> u4,
                                                                                                                                                                        Uni<? extends T5> u5,
                                                                                                                                                                        Uni<? extends T6> u6,
                                                                                                                                                                        Uni<? extends T7> u7,
                                                                                                                                                                        Uni<? extends T8> u8)
        Combines 8 unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple8 or computed using a Functions.Function8.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup8.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        T5 - the type of the item for the fifth uni
        T6 - the type of the item for the sixth uni
        T7 - the type of the item for the seventh uni
        T8 - the type of the item for the eighth uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        u5 - the fifth uni to be combined, must not be null
        u6 - the sixth uni to be combined, must not be null
        u7 - the seventh uni to be combined, must not be null
        u8 - the eighth uni to be combined, must not be null
        Returns:
        an UniAndGroup8 to configure the combination
      • unis

        @CheckReturnValue
        public <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9> UniAndGroup9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9> unis​(Uni<? extends T1> u1,
                                                                                                                                                                                          Uni<? extends T2> u2,
                                                                                                                                                                                          Uni<? extends T3> u3,
                                                                                                                                                                                          Uni<? extends T4> u4,
                                                                                                                                                                                          Uni<? extends T5> u5,
                                                                                                                                                                                          Uni<? extends T6> u6,
                                                                                                                                                                                          Uni<? extends T7> u7,
                                                                                                                                                                                          Uni<? extends T8> u8,
                                                                                                                                                                                          Uni<? extends T9> u9)
        Combines 9 unis together. Once all Uni have completed successfully, the item can be retrieved as a Tuple9 or computed using a Functions.Function9.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroup9.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        T1 - the type of the item for the first uni
        T2 - the type of the item for the second uni
        T3 - the type of the item for the third uni
        T4 - the type of the item for the fourth uni
        T5 - the type of the item for the fifth uni
        T6 - the type of the item for the sixth uni
        T7 - the type of the item for the seventh uni
        T8 - the type of the item for the eighth uni
        T9 - the type of the item for the ninth uni
        Parameters:
        u1 - the first uni to be combined, must not be null
        u2 - the second uni to be combined, must not be null
        u3 - the third uni to be combined, must not be null
        u4 - the fourth uni to be combined, must not be null
        u5 - the fifth uni to be combined, must not be null
        u6 - the sixth uni to be combined, must not be null
        u7 - the seventh uni to be combined, must not be null
        u8 - the eighth uni to be combined, must not be null
        u9 - the ninth uni to be combined, must not be null
        Returns:
        an UniAndGroup9 to configure the combination
      • unis

        @CheckReturnValue
        public <O> UniAndGroupIterable<O> unis​(Uni<?>... unis)
        Combines several unis together. Once all Uni have completed successfully, the item is computed using a combinator function.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroupIterable.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        O - the expected type of item produced by the combinator
        Parameters:
        unis - the list of unis, must not be null, must not contain null, must not be empty
        Returns:
        an UniAndGroupIterable to configure the combination
      • unis

        @CheckReturnValue
        public <O> UniAndGroupIterable<O> unis​(java.lang.Iterable<? extends Uni<?>> unis)
        Combines several unis together. Once all Uni have completed successfully, the item is computed using a combinator function.

        The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroupIterable.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event. If several unis fire a failure, the propagated failure is a CompositeException wrapping all the collected failures.

        Type Parameters:
        O - the expected type of item produced by the combinator
        Parameters:
        unis - the list of unis, must not be null, must not contain null, must not be empty
        Returns:
        an UniAndGroupIterable to configure the combination