public class Promises extends Object
| Constructor and Description |
|---|
Promises() |
| Modifier and Type | Method and Description |
|---|---|
static <T,S> Promise<List<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> Promise<List<T>> all(Collection<Promise<S>> promises)
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.public static <T> Promise<List<T>> all(Promise<? extends T>... promises)
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.Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.