public class

PendingResult

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

Class Overview

A pending result.

Summary

Public Constructors
PendingResult()
Public Methods
PendingResult<T> addCancelable(Cancelable cancelable)
Adds a Cancelable that will be called when the pending result is canceled.
PendingResult<T> addResultCallback(Looper looper, ResultCallback<T> resultCallback)
Adds a result callback.
PendingResult<T> addResultCallback(ResultCallback<T> resultCallback)
Adds a result callback.
final boolean cancel()
Cancels the operation.
boolean cancel(boolean mayInterruptIfRunning)
Cancels the operation.
T get(long l, TimeUnit timeUnit)
T get()
T getResult()
Returns the result if set.
boolean isCancelled()
Determines if the operation is canceled.
boolean isDone()
Determines if the operation is canceled or completed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.Cancelable
From interface java.util.concurrent.Future

Public Constructors

public PendingResult ()

Public Methods

public PendingResult<T> addCancelable (Cancelable cancelable)

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

Parameters
cancelable The instance that implements the Cancelable interface.

public PendingResult<T> addResultCallback (Looper looper, ResultCallback<T> resultCallback)

Adds a result callback.

Parameters
looper The looper to run the callback on.
resultCallback The result callback.
Returns
  • The pending result.

public PendingResult<T> addResultCallback (ResultCallback<T> resultCallback)

Adds a result callback.

Parameters
resultCallback The result callback.
Returns
  • The pending result.

public final boolean cancel ()

Cancels the operation.

Returns
  • false if the cancelable was able to be cancelled, otherwise true.

public boolean cancel (boolean mayInterruptIfRunning)

Cancels the operation.

Parameters
mayInterruptIfRunning true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete.
Returns
  • false if the cancelable was able to be cancelled, otherwise true.

public T get (long l, TimeUnit timeUnit)

public T get ()

public T getResult ()

Returns the result if set.

Returns
  • The result if set, otherwise null.

public boolean isCancelled ()

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