com.github.ignition.core.tasks
Class IgnitedAsyncTaskDefaultHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

java.lang.Object
  extended by com.github.ignition.core.tasks.IgnitedAsyncTaskDefaultHandler<ContextT,ProgressT,ReturnT>
Type Parameters:
ContextT -
ProgressT -
ReturnT -
All Implemented Interfaces:
IgnitedAsyncTaskHandler<ContextT,ProgressT,ReturnT>

public abstract class IgnitedAsyncTaskDefaultHandler<ContextT extends android.content.Context,ProgressT,ReturnT>
extends Object
implements IgnitedAsyncTaskHandler<ContextT,ProgressT,ReturnT>

Default implementation of the delegate handler interface with all callbacks methods defined to have empty bodies. Subclass this if you do not need to implement all methods of IgnitedAsyncTaskHandler. This class also handles a Context reference for you, so it's always preferred to use this class over implementing the handler interface yourself.

Author:
Matthias Kaeppler

Constructor Summary
IgnitedAsyncTaskDefaultHandler(ContextT context)
           
 
Method Summary
 ContextT getContext()
           
 boolean onTaskCompleted(ContextT context, ReturnT result)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskFailed(ContextT context, Exception error)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskProgress(ContextT context, ProgressT... progress)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskStarted(ContextT context)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskSuccess(ContextT context, ReturnT result)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 void setContext(ContextT context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnitedAsyncTaskDefaultHandler

public IgnitedAsyncTaskDefaultHandler(ContextT context)
Method Detail

getContext

public final ContextT getContext()
Specified by:
getContext in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

setContext

public final void setContext(ContextT context)
Specified by:
setContext in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

onTaskStarted

public boolean onTaskStarted(ContextT context)
Description copied from interface: IgnitedAsyncTaskHandler
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.

Specified by:
onTaskStarted in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

onTaskProgress

public boolean onTaskProgress(ContextT context,
                              ProgressT... progress)
Description copied from interface: IgnitedAsyncTaskHandler
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.

Specified by:
onTaskProgress in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

onTaskCompleted

public boolean onTaskCompleted(ContextT context,
                               ReturnT result)
Description copied from interface: IgnitedAsyncTaskHandler
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.

Specified by:
onTaskCompleted in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

onTaskSuccess

public boolean onTaskSuccess(ContextT context,
                             ReturnT result)
Description copied from interface: IgnitedAsyncTaskHandler
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.

Specified by:
onTaskSuccess in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

onTaskFailed

public boolean onTaskFailed(ContextT context,
                            Exception error)
Description copied from interface: IgnitedAsyncTaskHandler
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.

Specified by:
onTaskFailed in interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>


Copyright © 2012. All Rights Reserved.