public class Promise<T> extends Object implements Future<T>
| Modifier and Type | Field and Description |
|---|---|
protected Object |
error |
protected boolean |
hadResult |
protected boolean |
hasFired |
protected Object |
result |
protected Callback |
resultReceiver |
| Constructor and Description |
|---|
Promise() |
Promise(T result) |
Promise(T result,
Object error) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_isHadResult() |
boolean |
_isHasFired() |
void |
finishWith(Callback resultCB)
same as then, but avoid creation of new future
|
Object |
getError() |
String |
getId() |
Promise |
getLast() |
Promise |
getNext()
special method for tricky things.
|
T |
getResult() |
<OUT> Future<OUT> |
map(Filter<T,OUT> filter) |
void |
receive(Object res,
Object error) |
Promise<T> |
setId(String id) |
void |
signal()
same as receive(null,null)
|
Future |
then(Callback resultCB) |
String |
toString() |
protected Object result
protected Object error
protected Callback resultReceiver
protected boolean hadResult
protected boolean hasFired
public Promise(T result)
public Promise()
public String getId()
public Promise getNext()
public Promise getLast()
public void finishWith(Callback resultCB)
resultCB - public T getResult()
public void signal()
Futurepublic boolean _isHadResult()
public boolean _isHasFired()
Copyright © 2014. All rights reserved.