| java.lang.Object | |
| ↳ | com.google.firebase.tasks.Tasks |
Task utility methods.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static <T> T |
await(Task<T> task)
Blocks until the specified Task is complete.
| ||||||||||
| static <T> T |
await(Task<T> task, long timeout, TimeUnit unit)
Blocks until the specified Task is complete.
| ||||||||||
| static <T> Task<T> |
call(Callable<T> callable)
Returns a Task that will be completed with the result of the specified Callable.
| ||||||||||
| static <T> Task<T> |
call(Executor executor, Callable<T> callable)
Returns a Task that will be completed with the result of the specified Callable.
| ||||||||||
| static <T> Task<T> |
forException(Exception exception)
Returns a completed Task with the specified exception.
| ||||||||||
| static <T> Task<T> |
forResult(T result)
Returns a completed Task with the specified result.
| ||||||||||
| static Task<Void> |
whenAll(Collection<? extends Task<?>> tasks)
Returns a Task that completes successfully when all of the specified Tasks complete
successfully.
| ||||||||||
| static Task<Void> |
whenAll(Task...<?> tasks)
Returns a Task that completes successfully when all of the specified Tasks complete
successfully.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Blocks until the specified Task is complete.
| ExecutionException | if the Task fails |
|---|---|
| InterruptedException | if an interrupt occurs while waiting for the Task to complete |
Blocks until the specified Task is complete.
| ExecutionException | if the Task fails |
|---|---|
| InterruptedException | if an interrupt occurs while waiting for the Task to complete |
| TimeoutException | if the specified timeout is reached before the Task completes |
Returns a Task that will be completed with the result of the specified Callable.
The Callable will be called on a shared thread pool.
Returns a Task that will be completed with the result of the specified Callable.
| executor | the Executor to use to call the Callable |
|---|
Returns a completed Task with the specified exception.
Returns a Task that completes successfully when all of the specified Tasks complete successfully. Does not accept nulls.
| NullPointerException | if any of the provided Tasks are null |
|---|
Returns a Task that completes successfully when all of the specified Tasks complete successfully. Does not accept nulls.
| NullPointerException | if any of the provided Tasks are null |
|---|