org.solovyev.android.tasks
Class Tasks

java.lang.Object
  extended by org.solovyev.tasks.Tasks
      extended by org.solovyev.android.tasks.Tasks

public final class Tasks
extends org.solovyev.tasks.Tasks

Android tasks


Method Summary
static
<C extends android.content.Context,V>
com.google.common.util.concurrent.FutureCallback<V>
toFutureCallback(C context, ContextCallback<C,V> callback)
          Method convert specified context callback to FutureCallback.
static
<C extends android.content.Context,V>
org.solovyev.tasks.Task<V>
toTask(C context, ContextTask<C,V> task)
          Method converts specified context task to Task
static
<C extends android.content.Context,V>
org.solovyev.tasks.NamedTask<V>
toTask(C context, NamedContextTask<C,V> task)
           
static
<A extends android.app.Activity,V>
com.google.common.util.concurrent.FutureCallback<V>
toUiThreadFutureCallback(A activity, ContextCallback<A,V> callback)
          The only difference from Tasks#toFutureCallback(A, ContextCallback ) is that all ContextCallback method calls will be done on UI thread (main application thread)
static
<A extends android.app.Activity,V>
org.solovyev.tasks.Task<V>
toUiThreadTask(A activity, ContextTask<A,V> task)
          The only difference from Tasks#toTask(C, ContextTask) is that all ContextCallback method calls will be done on UI thread (main application thread)
static
<A extends android.app.Activity,V>
org.solovyev.tasks.NamedTask<V>
toUiThreadTask(A activity, NamedContextTask<A,V> task)
           
 
Methods inherited from class org.solovyev.tasks.Tasks
newTaskService, newTaskService, newTaskService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toUiThreadFutureCallback

@Nonnull
public static <A extends android.app.Activity,V> com.google.common.util.concurrent.FutureCallback<V> toUiThreadFutureCallback(@Nonnull
                                                                                                                                      A activity,
                                                                                                                                      @Nonnull
                                                                                                                                      ContextCallback<A,V> callback)
The only difference from Tasks#toFutureCallback(A, ContextCallback ) is that all ContextCallback method calls will be done on UI thread (main application thread)

See Also:
Tasks#toFutureCallback(A, ContextCallback )

toFutureCallback

@Nonnull
public static <C extends android.content.Context,V> com.google.common.util.concurrent.FutureCallback<V> toFutureCallback(@Nonnull
                                                                                                                                 C context,
                                                                                                                                 @Nonnull
                                                                                                                                 ContextCallback<C,V> callback)
Method convert specified context callback to FutureCallback.

Type Parameters:
C - type of context
V - type of result
Parameters:
context - context to be used in ContextCallback methods
callback - context callback
Returns:
FutureCallback wrapper for specified callback

toTask

@Nonnull
public static <C extends android.content.Context,V> org.solovyev.tasks.Task<V> toTask(@Nonnull
                                                                                              C context,
                                                                                              @Nonnull
                                                                                              ContextTask<C,V> task)
Method converts specified context task to Task

Type Parameters:
C - type of context
V - type of result
Parameters:
context - context to be used in ContextCallback methods
task - context task
Returns:
Task wrapper for specified task

toTask

@Nonnull
public static <C extends android.content.Context,V> org.solovyev.tasks.NamedTask<V> toTask(@Nonnull
                                                                                                   C context,
                                                                                                   @Nonnull
                                                                                                   NamedContextTask<C,V> task)

toUiThreadTask

@Nonnull
public static <A extends android.app.Activity,V> org.solovyev.tasks.Task<V> toUiThreadTask(@Nonnull
                                                                                                   A activity,
                                                                                                   @Nonnull
                                                                                                   ContextTask<A,V> task)
The only difference from Tasks#toTask(C, ContextTask) is that all ContextCallback method calls will be done on UI thread (main application thread)

See Also:
Tasks#toTask(C, ContextTask)

toUiThreadTask

@Nonnull
public static <A extends android.app.Activity,V> org.solovyev.tasks.NamedTask<V> toUiThreadTask(@Nonnull
                                                                                                        A activity,
                                                                                                        @Nonnull
                                                                                                        NamedContextTask<A,V> task)


Copyright © 2013. All Rights Reserved.