io.vertx.rxjava.core

## Class CompositeFuture

- java.lang.Object
- - io.vertx.rxjava.core.Future<CompositeFuture>
  - - io.vertx.rxjava.core.CompositeFuture

-     public class CompositeFuture
      extends Future<CompositeFuture>

  The composite future wraps a list of `futures`, it is useful when several futures needs to be coordinated. The handlers set for the coordinated futures are overridden by the handler of the composite future.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<CompositeFuture>` | `__TYPE_ARG`

    - ### Fields inherited from class io.vertx.rxjava.core.Future

      `__typeArg_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeFuture(CompositeFuture delegate)`
    `CompositeFuture(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T1,T2> CompositeFuture` | `all(Future<T1> f1, Future<T2> f2)` Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.
    `static <T1,T2,T3> CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
    `static <T1,T2,T3,T4> CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
    `static <T1,T2,T3,T4,T5> CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
    `static <T1,T2,T3,T4,T5,T6> CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
    `static CompositeFuture` | `all(List<Future> futures)` Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.
    `static <T1,T2> CompositeFuture` | `any(Future<T1> f1, Future<T2> f2)` Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.
    `static <T1,T2,T3> CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
    `static <T1,T2,T3,T4> CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
    `static <T1,T2,T3,T4,T5> CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
    `static <T1,T2,T3,T4,T5,T6> CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
    `static CompositeFuture` | `any(List<Future> futures)` Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.
    `Throwable` | `cause(int index)` Returns a cause of a wrapped future
    `<U> Future<U>` | `compose(java.util.function.Function<CompositeFuture,Future<U>> mapper)` Compose this future with a `mapper` function.
    `<U> Future<U>` | `compose(java.util.function.Function<CompositeFuture,Future<U>> successMapper, java.util.function.Function<Throwable,Future<U>> failureMapper)` Compose this future with a `successMapper` and `failureMapper` functions.
    `boolean` | `equals(Object o)`
    `boolean` | `failed(int index)` Returns true if a wrapped future is failed
    `<U> Future<U>` | `flatMap(java.util.function.Function<CompositeFuture,Future<U>> mapper)` Alias for `Future.compose(java.util.function.Function<T, io.vertx.rxjava.core.Future<U>>)`.
    `CompositeFuture` | `getDelegate()`
    `int` | `hashCode()`
    `boolean` | `isComplete(int index)` Returns true if a wrapped future is completed
    `static <T1,T2> CompositeFuture` | `join(Future<T1> f1, Future<T2> f2)` Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.
    `static <T1,T2,T3> CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
    `static <T1,T2,T3,T4> CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
    `static <T1,T2,T3,T4,T5> CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
    `static <T1,T2,T3,T4,T5,T6> CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
    `static CompositeFuture` | `join(List<Future> futures)` Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.
    `<U> Future<U>` | `map(java.util.function.Function<CompositeFuture,U> mapper)` Apply a `mapper` function on this future.
    `static CompositeFuture` | `newInstance(CompositeFuture arg)`
    `CompositeFuture` | `onComplete()` Add a handler to be notified of the result.
    `CompositeFuture` | `onComplete(Handler<AsyncResult<CompositeFuture>> handler)` Add a handler to be notified of the result.
    `CompositeFuture` | `onFailure(Handler<Throwable> handler)` Add a handler to be notified of the failed result.
    `CompositeFuture` | `onSuccess(Handler<CompositeFuture> handler)` Add a handler to be notified of the succeeded result.
    `Future<CompositeFuture>` | `otherwise(CompositeFuture value)` Map the failure of a future to a specific `value`.
    `Future<CompositeFuture>` | `otherwise(java.util.function.Function<Throwable,CompositeFuture> mapper)` Apply a `mapper` function on this future.
    `Future<CompositeFuture>` | `otherwiseEmpty()` Map the failure of a future to `null`.
    `Future<CompositeFuture>` | `recover(java.util.function.Function<Throwable,Future<CompositeFuture>> mapper)` Handles a failure of this Future by returning the result of another Future.
    `CompositeFuture` | `result()` The result of the operation.
    `<T> T` | `resultAt(int index)` Returns the result of a wrapped future
    `Single<CompositeFuture>` | `rxOnComplete()` Add a handler to be notified of the result.
    `int` | `size()`
    `boolean` | `succeeded(int index)` Returns true if a wrapped future is succeeded
    `String` | `toString()`

    - ### Methods inherited from class io.vertx.rxjava.core.Future

      `cause, failed, failedFuture, failedFuture, future, isComplete, map, mapEmpty, newInstance, newInstance, succeeded, succeededFuture, succeededFuture`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<CompositeFuture> __TYPE_ARG

  - ### Constructor Detail

    - #### CompositeFuture

          public CompositeFuture(CompositeFuture delegate)

    - #### CompositeFuture

          public CompositeFuture(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Future<CompositeFuture>`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Future<CompositeFuture>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Future<CompositeFuture>`

    - #### getDelegate

          public CompositeFuture getDelegate()

      Overrides:
        `getDelegate` in class `Future<CompositeFuture>`

    - #### result

          public CompositeFuture result()

      The result of the operation. This will be null if the operation failed.
      Overrides:
        `result` in class `Future<CompositeFuture>`
      Returns:
        the result or null if the operation failed.

    - #### flatMap

          public <U> Future<U> flatMap(java.util.function.Function<CompositeFuture,Future<U>> mapper)

      Alias for `Future.compose(java.util.function.Function<T, io.vertx.rxjava.core.Future<U>>)`.
      Overrides:
        `flatMap` in class `Future<CompositeFuture>`
      Parameters:
        `mapper` -
      Returns:

    - #### compose

          public <U> Future<U> compose(java.util.function.Function<CompositeFuture,Future<U>> mapper)

      Compose this future with a `mapper` function.

      When this future (the one on which `compose` is called) succeeds, the `mapper` will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `compose` in class `Future<CompositeFuture>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the composed future

    - #### recover

          public Future<CompositeFuture> recover(java.util.function.Function<Throwable,Future<CompositeFuture>> mapper)

      Handles a failure of this Future by returning the result of another Future. If the mapper fails, then the returned future will be failed with this failure.
      Overrides:
        `recover` in class `Future<CompositeFuture>`
      Parameters:
        `mapper` - A function which takes the exception of a failure and returns a new future.
      Returns:
        A recovered future

    - #### compose

          public <U> Future<U> compose(java.util.function.Function<CompositeFuture,Future<U>> successMapper,
                                       java.util.function.Function<Throwable,Future<U>> failureMapper)

      Compose this future with a `successMapper` and `failureMapper` functions.

      When this future (the one on which `compose` is called) succeeds, the `successMapper` will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      When this future (the one on which `compose` is called) fails, the `failureMapper` will be called with the failure and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      If any mapper function throws an exception, the returned future will be failed with this exception.

      Overrides:
        `compose` in class `Future<CompositeFuture>`
      Parameters:
        `successMapper` - the function mapping the success
        `failureMapper` - the function mapping the failure
      Returns:
        the composed future

    - #### map

          public <U> Future<U> map(java.util.function.Function<CompositeFuture,U> mapper)

      Apply a `mapper` function on this future.

      When this future succeeds, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `map` in class `Future<CompositeFuture>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the mapped future

    - #### otherwise

          public Future<CompositeFuture> otherwise(java.util.function.Function<Throwable,CompositeFuture> mapper)

      Apply a `mapper` function on this future.

      When this future fails, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future succeeds, the result will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `otherwise` in class `Future<CompositeFuture>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the mapped future

    - #### otherwise

          public Future<CompositeFuture> otherwise(CompositeFuture value)

      Map the failure of a future to a specific `value`.

      When this future fails, this `value` will complete the future returned by this method call.

      When this future succeeds, the result will be propagated to the returned future.

      Overrides:
        `otherwise` in class `Future<CompositeFuture>`
      Parameters:
        `value` - the value that eventually completes the mapped future
      Returns:
        the mapped future

    - #### otherwiseEmpty

          public Future<CompositeFuture> otherwiseEmpty()

      Map the failure of a future to `null`.

      This is a convenience for `future.otherwise((T) null)`.

      When this future fails, the `null` value will complete the future returned by this method call.

      When this future succeeds, the result will be propagated to the returned future.

      Overrides:
        `otherwiseEmpty` in class `Future<CompositeFuture>`
      Returns:
        the mapped future

    - #### all

          public static <T1,T2> CompositeFuture all(Future<T1> f1,
                                                    Future<T2> f2)

      Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

      The returned future fails as soon as one of `f1` or `f2` fails.
      Parameters:
        `f1` - future
        `f2` - future
      Returns:
        the composite future

    - #### all

          public static <T1,T2,T3> CompositeFuture all(Future<T1> f1,
                                                       Future<T2> f2,
                                                       Future<T3> f3)

      Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
      Returns:

    - #### all

          public static <T1,T2,T3,T4> CompositeFuture all(Future<T1> f1,
                                                          Future<T2> f2,
                                                          Future<T3> f3,
                                                          Future<T4> f4)

      Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
      Returns:

    - #### all

          public static <T1,T2,T3,T4,T5> CompositeFuture all(Future<T1> f1,
                                                             Future<T2> f2,
                                                             Future<T3> f3,
                                                             Future<T4> f4,
                                                             Future<T5> f5)

      Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
      Returns:

    - #### all

          public static <T1,T2,T3,T4,T5,T6> CompositeFuture all(Future<T1> f1,
                                                                Future<T2> f2,
                                                                Future<T3> f3,
                                                                Future<T4> f4,
                                                                Future<T5> f5,
                                                                Future<T6> f6)

      Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
        `f6` -
      Returns:

    - #### all

          public static CompositeFuture all(List<Future> futures)

      Like `all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Parameters:
        `futures` -
      Returns:

    - #### any

          public static <T1,T2> CompositeFuture any(Future<T1> f1,
                                                    Future<T2> f2)

      Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.

      The returned future succeeds as soon as one of `f1` or `f2` succeeds.
      Parameters:
        `f1` - future
        `f2` - future
      Returns:
        the composite future

    - #### any

          public static <T1,T2,T3> CompositeFuture any(Future<T1> f1,
                                                       Future<T2> f2,
                                                       Future<T3> f3)

      Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
      Returns:

    - #### any

          public static <T1,T2,T3,T4> CompositeFuture any(Future<T1> f1,
                                                          Future<T2> f2,
                                                          Future<T3> f3,
                                                          Future<T4> f4)

      Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
      Returns:

    - #### any

          public static <T1,T2,T3,T4,T5> CompositeFuture any(Future<T1> f1,
                                                             Future<T2> f2,
                                                             Future<T3> f3,
                                                             Future<T4> f4,
                                                             Future<T5> f5)

      Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
      Returns:

    - #### any

          public static <T1,T2,T3,T4,T5,T6> CompositeFuture any(Future<T1> f1,
                                                                Future<T2> f2,
                                                                Future<T3> f3,
                                                                Future<T4> f4,
                                                                Future<T5> f5,
                                                                Future<T6> f6)

      Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
        `f6` -
      Returns:

    - #### any

          public static CompositeFuture any(List<Future> futures)

      Like `any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Parameters:
        `futures` -
      Returns:

    - #### join

          public static <T1,T2> CompositeFuture join(Future<T1> f1,
                                                     Future<T2> f2)

      Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

      It always wait until all its futures are completed and will not fail as soon as one of `f1` or `f2` fails.
      Parameters:
        `f1` - future
        `f2` - future
      Returns:
        the composite future

    - #### join

          public static <T1,T2,T3> CompositeFuture join(Future<T1> f1,
                                                        Future<T2> f2,
                                                        Future<T3> f3)

      Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 3 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
      Returns:

    - #### join

          public static <T1,T2,T3,T4> CompositeFuture join(Future<T1> f1,
                                                           Future<T2> f2,
                                                           Future<T3> f3,
                                                           Future<T4> f4)

      Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 4 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
      Returns:

    - #### join

          public static <T1,T2,T3,T4,T5> CompositeFuture join(Future<T1> f1,
                                                              Future<T2> f2,
                                                              Future<T3> f3,
                                                              Future<T4> f4,
                                                              Future<T5> f5)

      Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 5 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
      Returns:

    - #### join

          public static <T1,T2,T3,T4,T5,T6> CompositeFuture join(Future<T1> f1,
                                                                 Future<T2> f2,
                                                                 Future<T3> f3,
                                                                 Future<T4> f4,
                                                                 Future<T5> f5,
                                                                 Future<T6> f6)

      Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with 6 futures.
      Parameters:
        `f1` -
        `f2` -
        `f3` -
        `f4` -
        `f5` -
        `f6` -
      Returns:

    - #### join

          public static CompositeFuture join(List<Future> futures)

      Like `join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)` but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Parameters:
        `futures` -
      Returns:

    - #### onComplete

          public CompositeFuture onComplete(Handler<AsyncResult<CompositeFuture>> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `onComplete` in class `Future<CompositeFuture>`
      Parameters:
        `handler` - the handler that will be called with the result
      Returns:
        a reference to this, so it can be used fluently

    - #### onComplete

          public CompositeFuture onComplete()

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `onComplete` in class `Future<CompositeFuture>`
      Returns:
        a reference to this, so it can be used fluently

    - #### rxOnComplete

          public Single<CompositeFuture> rxOnComplete()

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `rxOnComplete` in class `Future<CompositeFuture>`
      Returns:
        a reference to this, so it can be used fluently

    - #### onSuccess

          public CompositeFuture onSuccess(Handler<CompositeFuture> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the succeeded result.
      Overrides:
        `onSuccess` in class `Future<CompositeFuture>`
      Parameters:
        `handler` - the handler that will be called with the succeeded result
      Returns:
        a reference to this, so it can be used fluently

    - #### onFailure

          public CompositeFuture onFailure(Handler<Throwable> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the failed result.
      Overrides:
        `onFailure` in class `Future<CompositeFuture>`
      Parameters:
        `handler` - the handler that will be called with the failed result
      Returns:
        a reference to this, so it can be used fluently

    - #### cause

          public Throwable cause(int index)

      Returns a cause of a wrapped future
      Parameters:
        `index` - the wrapped future index
      Returns:

    - #### succeeded

          public boolean succeeded(int index)

      Returns true if a wrapped future is succeeded
      Parameters:
        `index` - the wrapped future index
      Returns:

    - #### failed

          public boolean failed(int index)

      Returns true if a wrapped future is failed
      Parameters:
        `index` - the wrapped future index
      Returns:

    - #### isComplete

          public boolean isComplete(int index)

      Returns true if a wrapped future is completed
      Parameters:
        `index` - the wrapped future index
      Returns:

    - #### resultAt

          public <T> T resultAt(int index)

      Returns the result of a wrapped future
      Parameters:
        `index` - the wrapped future index
      Returns:

    - #### size

          public int size()

      Returns:
        the number of wrapped future

    - #### newInstance

          public static CompositeFuture newInstance(CompositeFuture arg)

Copyright © 2020 Eclipse. All rights reserved.