Tasks
public
final
class
Tasks
extends Object
java.lang.Object
|
↳ |
com.google.android.play.core.tasks.Tasks
|
Task
utility methods.
Summary
Public methods |
static
<ResultT>
ResultT
|
await(Task<ResultT> task, long timeout, TimeUnit unit)
Blocks until the specified Task is complete.
|
static
<ResultT>
ResultT
|
await(Task<ResultT> task)
Blocks until the specified Task is complete.
|
static
Task<Void>
|
whenAll(Collection<? extends Task<?>> tasks)
Returns a Task that completes successfully when all of the specified Tasks complete
successfully.
|
Inherited methods |
From
class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
await
ResultT await (Task<ResultT> task,
long timeout,
TimeUnit unit)
Blocks until the specified Task is complete.
Parameters |
task |
Task |
timeout |
long |
unit |
TimeUnit |
Returns |
ResultT |
the Task's result |
Throws |
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
|
await
ResultT await (Task<ResultT> task)
Blocks until the specified Task is complete.
Returns |
ResultT |
the Task's result |
Throws |
ExecutionException |
if the Task fails |
InterruptedException |
if an interrupt occurs while waiting for the Task to complete
|
whenAll
Task<Void> whenAll (Collection<? extends Task<?>> tasks)
Returns a Task that completes successfully when all of the specified Tasks complete
successfully. Does not accept nulls.
The returned Task would fail if any of the provided Tasks fail. The returned Task would be
set to canceled if any of the provided Tasks is canceled and no failure is detected.
Parameters |
tasks |
Collection |
Throws |
NullPointerException |
if any of the provided Tasks are null
|