Go to console

StorageTask

public abstract class StorageTask extends ControllableTask<ResultT extends StorageTask.ProvideError>
Known Direct Subclasses

A controllable Task that has a synchronized state machine.

Nested Class Summary

interface StorageTask.ProvideError An object that returns an exception. 
class StorageTask.SnapshotBase Base class for state. 

Field Summary

protected final Object syncObject

Protected Constructor Summary

Public Method Summary

StorageTask<ResultT>
addOnCanceledListener(OnCanceledListener listener)
Adds a listener that is called if the Task is canceled.
StorageTask<ResultT>
addOnCanceledListener(Executor executor, OnCanceledListener listener)
Adds a listener that is called if the Task is canceled.
StorageTask<ResultT>
addOnCanceledListener(Activity activity, OnCanceledListener listener)
Adds an Activity-scoped listener that is called if the Task is canceled.
StorageTask<ResultT>
addOnCompleteListener(Activity activity, OnCompleteListener<ResultT> listener)
Adds a listener that is called when the Task succeeds or fails.
StorageTask<ResultT>
addOnCompleteListener(OnCompleteListener<ResultT> listener)
Adds a listener that is called when the Task succeeds or fails.
StorageTask<ResultT>
addOnCompleteListener(Executor executor, OnCompleteListener<ResultT> listener)
Adds a listener that is called when the Task succeeds or fails.
StorageTask<ResultT>
addOnFailureListener(Activity activity, OnFailureListener listener)
Adds a listener that is called if the Task fails.
StorageTask<ResultT>
addOnFailureListener(OnFailureListener listener)
Adds a listener that is called if the Task fails.
StorageTask<ResultT>
addOnFailureListener(Executor executor, OnFailureListener listener)
Adds a listener that is called if the Task fails.
StorageTask<ResultT>
addOnPausedListener(Executor executor, OnPausedListener<? super ResultT> listener)
Adds a listener that is called when the Task becomes paused.
StorageTask<ResultT>
addOnPausedListener(OnPausedListener<? super ResultT> listener)
Adds a listener that is called when the Task becomes paused.
StorageTask<ResultT>
addOnPausedListener(Activity activity, OnPausedListener<? super ResultT> listener)
Adds a listener that is called when the Task becomes paused.
StorageTask<ResultT>
addOnProgressListener(OnProgressListener<? super ResultT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
StorageTask<ResultT>
addOnProgressListener(Activity activity, OnProgressListener<? super ResultT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
StorageTask<ResultT>
addOnProgressListener(Executor executor, OnProgressListener<? super ResultT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
StorageTask<ResultT>
addOnSuccessListener(OnSuccessListener<? super ResultT> listener)
Adds a listener that is called if the Task completes successfully.
StorageTask<ResultT>
addOnSuccessListener(Executor executor, OnSuccessListener<? super ResultT> listener)
Adds a listener that is called if the Task completes successfully.
StorageTask<ResultT>
addOnSuccessListener(Activity activity, OnSuccessListener<? super ResultT> listener)
Adds a listener that is called if the Task completes successfully.
boolean
cancel()
Attempts to cancel the task.
<ContinuationResultT> Task<ContinuationResultT>
continueWith(Continuation<ResultT, ContinuationResultT> continuation)
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
<ContinuationResultT> Task<ContinuationResultT>
continueWith(Executor executor, Continuation<ResultT, ContinuationResultT> continuation)
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
<ContinuationResultT> Task<ContinuationResultT>
continueWithTask(Executor executor, Continuation<ResultT, Task<ContinuationResultT>> continuation)
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
<ContinuationResultT> Task<ContinuationResultT>
continueWithTask(Continuation<ResultT, Task<ContinuationResultT>> continuation)
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
Exception
getException()
Returns the exception that caused the Task to fail.
ResultT
getResult()
Gets the result of the Task, if it has already completed.
<X extends Throwable> ResultT
getResult(Class<X> exceptionType)
Gets the result of the Task, if it has already completed.
ResultT
getSnapshot()
Returns the current state of the task.
boolean
isCanceled()
Returns true if the task has been canceled.