Package io.joynr.provider
Class Promise<T extends AbstractDeferred>
- java.lang.Object
-
- io.joynr.provider.Promise<T>
-
public class Promise<T extends AbstractDeferred> extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFulfilled()booleanisRejected()booleanisSettled()voidthen(PromiseListener listener)Adds a listener that is called once the promise is settled.
-
-
-
Constructor Detail
-
Promise
public Promise(T deferred)
-
-
Method Detail
-
then
public void then(PromiseListener listener)
Adds a listener that is called once the promise is settled. NOTE: If the promise is already settled when adding the listener, the thread adding the listener will be used to execute the listener.- Parameters:
listener- the listener that will be called once the promise is settled
-
isFulfilled
public boolean isFulfilled()
-
isRejected
public boolean isRejected()
-
isSettled
public boolean isSettled()
- Returns:
- true if the promise is fulfilled or rejected; false if the promise is pending.
-
-