public class DefaultFutureResult<T> extends java.lang.Object implements Future<T>
| Constructor and Description |
|---|
DefaultFutureResult()
Create a FutureResult that hasn't completed yet
|
DefaultFutureResult(T result)
Create a FutureResult that has already succeeded
|
DefaultFutureResult(java.lang.Throwable t)
Create a VoidResult that has already completed
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
cause()
An exception describing failure.
|
boolean |
complete()
Has it completed?
|
boolean |
failed()
Did it fail?
|
T |
result()
The result of the operation.
|
DefaultFutureResult<T> |
setFailure(java.lang.Throwable throwable)
Set the failure.
|
DefaultFutureResult<T> |
setHandler(Handler<AsyncResult<T>> handler)
Set a handler for the result.
|
DefaultFutureResult<T> |
setResult(T result)
Set the result.
|
boolean |
succeeded()
Did it succeeed?
|
public DefaultFutureResult()
public DefaultFutureResult(java.lang.Throwable t)
t - The Throwable or null if succeededpublic DefaultFutureResult(T result)
result - The resultpublic T result()
result in interface AsyncResult<T>public java.lang.Throwable cause()
cause in interface AsyncResult<T>public boolean succeeded()
succeeded in interface AsyncResult<T>public boolean failed()
failed in interface AsyncResult<T>public DefaultFutureResult<T> setHandler(Handler<AsyncResult<T>> handler)
setHandler in interface Future<T>public DefaultFutureResult<T> setResult(T result)
public DefaultFutureResult<T> setFailure(java.lang.Throwable throwable)
setFailure in interface Future<T>