| java.lang.Object | |
| ↳ | com.google.firebase.tasks.Task<T> |
This class is deprecated.
Task has been deprecated in favor of
ApiFuture.
For every method x() that returns a Task<T>, you should be able to find a
corresponding xAsync() method that returns an ApiFuture<T>.
Represents an asynchronous operation.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task<T> |
addOnCompleteListener(OnCompleteListener<T> listener)
This method is deprecated.
Use
addOnCompleteListener(Executor, OnCompleteListener)
| ||||||||||
| Task<T> |
addOnCompleteListener(Executor executor, OnCompleteListener<T> listener)
Adds a listener that is called when the Task completes.
| ||||||||||
| abstract Task<T> |
addOnFailureListener(Executor executor, OnFailureListener listener)
Adds a listener that is called if the Task fails.
| ||||||||||
| abstract Task<T> |
addOnFailureListener(OnFailureListener listener)
This method is deprecated.
Use
addOnFailureListener(Executor, OnFailureListener)
| ||||||||||
| abstract Task<T> |
addOnSuccessListener(OnSuccessListener<? super T> listener)
This method is deprecated.
Use
addOnSuccessListener(Executor, OnSuccessListener)
| ||||||||||
| abstract Task<T> |
addOnSuccessListener(Executor executor, OnSuccessListener<? super T> listener)
Adds a listener that is called if the Task completes successfully.
| ||||||||||
| <R> Task<R> |
continueWith(Executor executor, Continuation<T, R> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| ||||||||||
| <R> Task<R> |
continueWith(Continuation<T, R> continuation)
This method is deprecated.
Use
continueWith(Executor, Continuation).
| ||||||||||
| <R> Task<R> |
continueWithTask(Continuation<T, Task<R>> continuation)
This method is deprecated.
Use
continueWithTask(Executor, Continuation)
| ||||||||||
| <R> Task<R> |
continueWithTask(Executor executor, Continuation<T, Task<R>> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| ||||||||||
| abstract Exception |
getException()
Returns the exception that caused the Task to fail.
| ||||||||||
| abstract T |
getResult()
Gets the result of the Task, if it has already completed.
| ||||||||||
| abstract <X extends Throwable> T |
getResult(Class<X> exceptionType)
Gets the result of the Task, if it has already completed.
| ||||||||||
| abstract boolean |
isComplete()
Returns
true if the Task is complete; false otherwise. | ||||||||||
| abstract boolean |
isSuccessful()
Returns
true if the Task has completed successfully; false otherwise. | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
This method is deprecated.
Use addOnCompleteListener(Executor, OnCompleteListener)
Adds a listener that is called when the Task completes.
The listener will be called on a shared thread pool. If the Task is already complete, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
Adds a listener that is called when the Task completes.
If the Task is already complete, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| executor | the executor to use to call the listener |
|---|
Adds a listener that is called if the Task fails.
If the Task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| executor | the executor to use to call the listener |
|---|
This method is deprecated.
Use addOnFailureListener(Executor, OnFailureListener)
Adds a listener that is called if the Task fails.
The listener will be called on a shared thread pool. If the Task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
This method is deprecated.
Use addOnSuccessListener(Executor, OnSuccessListener)
Adds a listener that is called if the Task completes successfully.
The listener will be called on a shared thread pool. If the Task has already completed successfully, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
Adds a listener that is called if the Task completes successfully.
If multiple listeners are added, they will be called in the order in which they were added. If the Task has already completed successfully, a call to the listener will be immediately scheduled.
| executor | the executor to use to call the listener |
|---|
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
If the Continuation throws an exception, the returned Task will fail with that exception.
| executor | the executor to use to call the Continuation |
|---|
This method is deprecated.
Use continueWith(Executor, Continuation).
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
If the Continuation throws an exception, the returned Task will fail with that exception.
The Continuation will be called on a shared thread pool.
This method is deprecated.
Use continueWithTask(Executor, Continuation)
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
If the Continuation throws an exception, the returned Task will fail with that exception.
The Continuation will be called on a shared thread pool.
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
If the Continuation throws an exception, the returned Task will fail with that exception.
| executor | the executor to use to call the Continuation |
|---|
Returns the exception that caused the Task to fail. Returns null if the Task is not yet
complete, or completed successfully.
Gets the result of the Task, if it has already completed.
| IllegalStateException | if the Task is not yet complete |
|---|---|
| RuntimeExecutionException | if the Task failed with an exception |
Gets the result of the Task, if it has already completed.
| IllegalStateException | if the Task is not yet complete |
|---|---|
| if the Task failed with an exception of type X | |
| RuntimeExecutionException | if the Task failed with an exception that was not of type X |
| Throwable |
Returns true if the Task is complete; false otherwise.
Returns true if the Task has completed successfully; false otherwise.