Modifier and Type | Method and Description |
---|---|
static Promise<Void> |
allOf(Collection<? extends Promise<?>> promises)
Returns a new promise that
completes when all promises from the given collection complete. |
static Promise<Void> |
allOf(Promise<?>... promises)
Returns a new promise that
completes when all promises from the given array complete. |
static <T> Promise<T> |
anyOf(Collection<? extends Promise<T>> promises)
Returns a new promise that
completes when any promise from the given collection complete. |
static <T> Promise<T> |
anyOf(Promise<T>... promises)
Returns a new promise that
completes when any promise from the given array complete. |
public static Promise<Void> allOf(Collection<? extends Promise<?>> promises)
completes
when all promises from the given collection complete.
If any of the given promises complete exceptionally
, then the returned promise
also does so with the same exception
and all non-completed promises in the
list are canceled
.
Otherwise, the results, if any, of the given promises are not reflected in the returned promise, but may be
obtained by inspecting them individually. If no promises are provided, returns a promise completed
with the value null.
When the resulting promise completes for any reason (is canceled
, for example)
then all of the promises from the given collection are canceled.promises
- a collection of promises.completes
when all promises from the given collection complete.NullPointerException
- if promises is null or any individual promise there is null.public static Promise<Void> allOf(Promise<?>... promises)
completes
when all promises from the given array complete.
If any of the given promises complete exceptionally
, then the returned promise
also does so with the same exception
and all non-completed promises in the
array are canceled
.
Otherwise, the results, if any, of the given promises are not reflected in the returned promise, but may be
obtained by inspecting them individually. If no promises are provided, returns a promise completed
with the value null.
When the resulting promise completes for any reason (is canceled
, for example)
then all of the promises from the given array are canceled.promises
- an array of promises.completes
when all promises from the given array complete.NullPointerException
- if promises is null or any individual promise there is null.public static <T> Promise<T> anyOf(Collection<? extends Promise<T>> promises)
completes
when any promise from the given collection complete.
If any of the given promises complete exceptionally
, then the returned promise
also does so with the same exception
and all non-completed promises in the
list are canceled
.
If any of the given promises complete with result
, then the returned promise
also does so with the same result
and all non-completed promises in the
list are canceled
.
When the resulting promise completes for any reason (is canceled
, for example)
then all of the promises from the given collection are canceled.promises
- a collection of promises.completes
when any promise from the given collection completes.NullPointerException
- if promises is null or any individual promise there is null.public static <T> Promise<T> anyOf(Promise<T>... promises)
completes
when any promise from the given array complete.
If any of the given promises complete exceptionally
, then the returned promise
also does so with the same exception
and all non-completed promises in the
list are canceled
.
If any of the given promises complete with result
, then the returned promise
also does so with the same result
and all non-completed promises in the
list are canceled
.
When the resulting promise completes for any reason (is canceled
, for example)
then all of the promises from the given array are canceled.promises
- a collection of promises.completes
when any promise from the given array completes.NullPointerException
- if promises is null or any individual promise there is null.Copyright © 2014 Devexperts. All Rights Reserved.