public class

PendingResult

extends Object
implements Cancelable
java.lang.Object
   ↳ com.urbanairship.PendingResult<T>

Class Overview

A generic pending result.

Summary

Nested Classes
interface PendingResult.ResultCallback<T> Result callback interface. 
Public Constructors
PendingResult(ResultCallback<T> callback)
Public Methods
void addCancelable(Cancelable cancelable)
Adds a CancelableOperation that will be called when the pending result is canceled.
void cancel()
Cancels the pending result.
boolean isCanceled()
Determines if the operation is canceled.
boolean isDone()
Determines if the operation is canceled or completed.
void setResult(T result)
Sets the pending result.
Protected Methods
void onCancel()
Called when the PendingResult is canceled.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.Cancelable

Public Constructors

public PendingResult (ResultCallback<T> callback)

Public Methods

public void addCancelable (Cancelable cancelable)

Adds a CancelableOperation that will be called when the pending result is canceled. If the pending result is already canceled the operation will immediately be canceled.

public void cancel ()

Cancels the pending result.

public boolean isCanceled ()

Determines if the operation is canceled.

Returns
  • true if canceled, otherwise false

public boolean isDone ()

Determines if the operation is canceled or completed.

Returns
  • true if canceled or completed, otherwise false

public void setResult (T result)

Sets the pending result.

Parameters
result The pending result.

Protected Methods

protected void onCancel ()

Called when the PendingResult is canceled.