Modifier and Type | Method and Description |
---|---|
static <T,S extends T> |
all(Collection<Promise<S>> promises)
Create a new Promise that is a latch on the resolution of the specified
Promises.
|
static <T> Promise<List<T>> |
all(Promise<? extends T>... promises)
Create a new Promise that is a latch on the resolution of the specified
Promises.
|
static <T> Promise<T> |
failed(Throwable failure)
Create a new Promise that has been resolved with the specified failure.
|
static <T> Promise<T> |
resolved(T value)
Create a new Promise that has been resolved with the specified value.
|
public static <T> Promise<T> resolved(T value)
T
- The value type associated with the returned Promise.value
- The value of the resolved Promise.public static <T> Promise<T> failed(Throwable failure)
T
- The value type associated with the returned Promise.failure
- The failure of the resolved Promise. Must not be
null
.public static <T,S extends T> Promise<List<T>> all(Collection<Promise<S>> promises)
The new Promise acts as a gate and must be resolved after all of the specified Promises are resolved.
T
- The value type of the List value associated with the returned
Promise.S
- A subtype of the value type of the List value associated with
the returned Promise.promises
- The Promises which must be resolved before the returned
Promise must be resolved. Must not be null
and all of the
elements in the collection must not be null
.FailedPromisesException
if any of the specified
Promises are resolved with a failure. The failure
FailedPromisesException
must contain all of the specified
Promises which resolved with a failure.public static <T> Promise<List<T>> all(Promise<? extends T>... promises)
The new Promise acts as a gate and must be resolved after all of the specified Promises are resolved.
T
- The value type associated with the specified Promises.promises
- The Promises which must be resolved before the returned
Promise must be resolved. Must not be null
and all of the
arguments must not be null
.FailedPromisesException
if any of the specified
Promises are resolved with a failure. The failure
FailedPromisesException
must contain all of the specified
Promises which resolved with a failure.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0