com.unclouded.android
Class PromiseListener<T extends Serializable>

java.lang.Object
  extended by com.unclouded.android.PromiseListener<T>
Type Parameters:
T - the type of the return value that is expected to be resolved. It should implement Serializable because return values are passed by copy.

public abstract class PromiseListener<T extends Serializable>
extends Object

Monitors the state of a promise.

The isResolved callback method is triggered when the corresponding Promise is resolved.


Constructor Summary
PromiseListener()
           
 
Method Summary
abstract  void isResolved(T value)
          Triggered when the return value of the promise is resolved.
 void isRuined()
          Triggered when something went wrong during the process of resolving the promise.
 String toString()
          Returns a string representation of a PromiseListener object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PromiseListener

public PromiseListener()
Method Detail

isResolved

public abstract void isResolved(T value)
Triggered when the return value of the promise is resolved.

Parameters:
value - the resolved return value.

isRuined

public void isRuined()
Triggered when something went wrong during the process of resolving the promise.


toString

public String toString()
Returns a string representation of a PromiseListener object.

Overrides:
toString in class Object
Returns:
a string representation of the promise listener.