A callback abstraction that handles completed/failed events of asynchronous operations.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class |
| Modifier and Type | Method and Description |
|---|---|
| public default void | completeWith(CompletableFuture<C>
the CompletableFuture that completes this promise completable)Completes this promise with the given |
| public default void | |
| public static < the type of the result T> Promise | |
| public static < the type of the result T> Promise | Returns: a promise that when completed, completes the given CompletableFuturethe CompletableFuture to convert into a promise completable)Creates a promise from the given incomplete CompletableFuture. |
| public static <T> Promise | |
| public default void |
| NOOP | back to summary |
|---|---|
| public static final Promise<Object> NOOP | |
| completeWith | back to summary |
|---|---|
| public default void completeWith(CompletableFuture<C> completable) Completes this promise with the given When the CompletableFuture completes normally, this promise is succeeded; when the CompletableFuture completes exceptionally, this promise is failed.
| |
| failed | back to summary |
|---|---|
| public default void failed(Throwable x) Callback invoked when the operation fails.
| |
| from | back to summary |
|---|---|
| public static <T> Promise Creates a Promise from the given success and failure consumers. | |
| from | back to summary |
|---|---|
| public static <T> Promise Creates a promise from the given incomplete CompletableFuture. When the promise completes, either succeeding or failing, the
CompletableFuture is also completed, respectively via
| |
| noop | back to summary |
|---|---|
public static <T> Promise
| |
| succeeded | back to summary |
|---|---|
| public default void succeeded(C result) Callback invoked when the operation completes.
| |
Empty implementation of Promise.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | failed(Throwable
the reason for the operation failure x)Overrides default org. Callback invoked when the operation fails. |
| Adapter | back to summary |
|---|---|
| public Adapter() | |
| failed | back to summary |
|---|---|
| public void failed(Throwable x) Overrides default org. Doc from org. Callback invoked when the operation fails. | |
A CompletableFuture that is also a Promise.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | failed(Throwable
the reason for the operation failure x)Overrides default org. Callback invoked when the operation fails. |
| public void | succeeded(S
the context result)Overrides default org. Callback invoked when the operation completes. |
| public static < the type of the result R> Promise. |
| Completable | back to summary |
|---|---|
| public Completable() | |
| failed | back to summary |
|---|---|
| public void failed(Throwable x) Overrides default org. Doc from org. Callback invoked when the operation fails. | |
| succeeded | back to summary |
|---|---|
| public void succeeded(S result) Overrides default org. Doc from org. Callback invoked when the operation completes.
| |
| with | back to summary |
|---|---|
| public static <R> Promise. Creates a new
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | failed(Throwable
the reason for the operation failure x)Overrides default org. Callback invoked when the operation fails. |
| public Promise | |
| public void | succeeded(W
the context result)Overrides default org. Callback invoked when the operation completes. |
| public Promise |
| promise | back to summary |
|---|---|
| private final Promise<W> promise | |
| Wrapper | back to summary |
|---|---|
| public Wrapper(Promise<W> promise) | |
| failed | back to summary |
|---|---|
| public void failed(Throwable x) Overrides default org. Doc from org. Callback invoked when the operation fails. | |
| getPromise | back to summary |
|---|---|
| public Promise | |
| succeeded | back to summary |
|---|---|
| public void succeeded(W result) Overrides default org. Doc from org. Callback invoked when the operation completes.
| |
| unwrap | back to summary |
|---|---|
| public Promise | |