public interface Future<T> extends AsyncResult<T>
Modifier and Type | Field and Description |
---|---|
static FutureFactory |
factory |
Modifier and Type | Method and Description |
---|---|
void |
complete() |
void |
complete(T result)
Set the result.
|
void |
fail(String failureMessage) |
void |
fail(Throwable throwable)
Set the failure.
|
static <T> Future<T> |
failedFuture(String failureMessage) |
static <T> Future<T> |
failedFuture(Throwable t) |
static <T> Future<T> |
future() |
boolean |
isComplete()
Has it completed?
|
void |
setHandler(Handler<AsyncResult<T>> handler)
Set a handler for the result.
|
static <T> Future<T> |
succeededFuture() |
static <T> Future<T> |
succeededFuture(T result) |
cause, failed, result, succeeded
static final FutureFactory factory
static <T> Future<T> future()
static <T> Future<T> succeededFuture()
static <T> Future<T> succeededFuture(T result)
boolean isComplete()
Has it completed?
void setHandler(Handler<AsyncResult<T>> handler)
Set a handler for the result. It will get called when it’s complete
void complete(T result)
Set the result. Any handler will be called, if there is one
IllegalStateException
- when the future is already completedvoid complete()
void fail(Throwable throwable)
Set the failure. Any handler will be called, if there is one
void fail(String failureMessage)
Copyright © 2014. All Rights Reserved.