public final class AssignedFuture extends java.lang.Object implements Future
Future.Observer
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
blockingGet()
Blocking get, waiting until the future has been resolved.
|
static AssignedFuture |
failedFuture(java.lang.Throwable throwable)
Builds a new future that has failed.
|
java.lang.Object |
get()
Non-blocking get.
|
boolean |
isFailed()
Test whether the future has failed.
|
boolean |
isResolved()
Test whether the future has been resolved, that is, the future is either set or failed.
|
Future |
onFail(Future.Observer observer)
Registers a callback for when the future fails.
|
Future |
onSet(Future.Observer observer)
Registers a callback for when the future is set.
|
static AssignedFuture |
setFuture(java.lang.Object value)
Builds a new future that has been set to a value.
|
java.lang.String |
toString() |
public static AssignedFuture setFuture(java.lang.Object value)
value
- the future value.public static AssignedFuture failedFuture(java.lang.Throwable throwable)
throwable
- the failure.public java.lang.Object blockingGet() throws java.lang.InterruptedException
Future
blockingGet
in interface Future
java.lang.InterruptedException
- when the current thread is being interrupted.public boolean isResolved()
Future
isResolved
in interface Future
true
if the future is resolved, false
otherwise.public boolean isFailed()
Future
public Future onSet(Future.Observer observer)
Future
public Future onFail(Future.Observer observer)
Future
public java.lang.String toString()
toString
in class java.lang.Object