Represents the result of an action that may, or may not, have occurred yet.
Anything
Object
Future
Basic
Identifiable
Object
Anything
Initializer |
Future(Future<out Object> unknown) |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
cause | shared default Throwable cause() A Throwable describing failure. This will be null if the operation succeeded. |
complete | shared default void complete() Set a null result. Any handler will be called, if there is one, and the future will be marked as completed. |
complete | shared default void complete(T result) Set the result. Any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
completer | shared default Anything(Throwable|T) completer() |
compose | shared default Future<U?> compose<U>(Future<U?>(T) mapper) Compose this future with a When this future (the one on which If the When this future fails, the failure will be propagated to the returned future and the Parameters:
|
compose | shared default Future<U?> compose<U>(Anything(T) handler, Future<U?> next) Compose this future with a provided When this (the one on which If the When this future fails, the failure will be propagated to the Parameters:
|
fail | shared default void fail(String failureMessage) Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
fail | shared default void fail(Throwable cause) Set the failure. Any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
failed | shared default Boolean failed() Did it fail? |
isComplete | shared default Boolean isComplete() Has the future completed? It's completed if it's either succeeded or failed. |
map | shared default Future<U?> map<U>(U?(T) mapper) Apply a When this future succeeds, the If the When this future fails, the failure will be propagated to the returned future and the Parameters:
|
map | shared default Future<V?> map<V>(V? value) Map the result of a future to a specific When this future succeeds, this When this future fails, the failure will be propagated to the returned future. Parameters:
|
mapEmpty | shared default Future<V?> mapEmpty<V>() Map the result of a future to This is a conveniency for When this future succeeds, When this future fails, the failure will be propagated to the returned future. |
otherwise | shared default Future<T> otherwise(T value) Map the failure of a future to a specific When this future fails, this When this future succeeds, the result will be propagated to the returned future. Parameters:
|
otherwise | shared default Future<T> otherwise(T(Throwable) mapper) Apply a When this future fails, the If the When this future succeeds, the result will be propagated to the returned future and the Parameters:
|
otherwiseEmpty | shared default Future<T> otherwiseEmpty() Map the failure of a future to This is a convenience for When this future fails, the When this future succeeds, the result will be propagated to the returned future. |
recover | shared default Future<T> recover(Future<T>(Throwable) mapper) Handles a failure of this Future by returning the result of another Future. If the mapper fails, then the returned future will be failed with this failure. Parameters:
|
result | shared default T result() The result of the operation. This will be null if the operation failed. |
setHandler | shared default Future<T> setHandler(Anything(Throwable|T) handler) Set a handler for the result. If the future has already been completed it will be called immediately. Otherwise it will be called when the future is completed. Parameters:
|
succeeded | shared default Boolean succeeded() Did it succeed? |
tryComplete | shared default Boolean tryComplete() Try to set the result. When it happens, any handler will be called, if there is one, and the future will be marked as completed. |
tryComplete | shared default Boolean tryComplete(T result) Set the failure. Any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
tryFail | shared default Boolean tryFail(String failureMessage) Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
tryFail | shared default Boolean tryFail(Throwable cause) Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed. Parameters:
|
Inherited Methods |
Methods inherited from: Object equals |