| java.lang.Object | |
| ↳ | com.google.firebase.tasks.TaskCompletionSource<T> |
Provides the ability to create an incomplete Task and later complete it by either calling
setResult(T) or setException(Exception).
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| TaskCompletionSource() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task<T> |
getTask()
Returns the Task.
| ||||||||||
| void |
setException(Exception e)
Completes the Task with the specified exception.
| ||||||||||
| void |
setResult(T result)
Completes the Task with the specified result.
| ||||||||||
| boolean |
trySetException(Exception e)
Completes the Task with the specified exception, unless the Task has already completed.
| ||||||||||
| boolean |
trySetResult(T result)
Completes the Task with the specified result, unless the Task has already completed.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Completes the Task with the specified exception.
| IllegalStateException | if the Task is already complete |
|---|
Completes the Task with the specified result.
| IllegalStateException | if the Task is already complete |
|---|
Completes the Task with the specified exception, unless the Task has already completed. If the Task has already completed, the call does nothing.
true if the exception was set successfully, false otherwise
Completes the Task with the specified result, unless the Task has already completed. If the Task has already completed, the call does nothing.
true if the result was set successfully, false otherwise