com.path.android.jobqueue
Class Params

java.lang.Object
  extended by com.path.android.jobqueue.Params

public class Params
extends java.lang.Object

BaseJob builder object to have a more readable design. Methods can be chained to have more readable code.


Constructor Summary
Params(int priority)
           
 
Method Summary
 Params delayInMs(long delayMs)
          Delays the job in given ms.
 boolean doesRequireNetwork()
           
 long getDelayMs()
           
 java.lang.String getGroupId()
           
 int getPriority()
           
 Params groupBy(java.lang.String groupId)
          Sets the group id.
 boolean isPersistent()
           
 Params persist()
          Marks the job as persistent.
 Params requireNetwork()
          Sets the Job as requiring network
 Params setDelayMs(long delayMs)
          convenience method to set delay
 Params setGroupId(java.lang.String groupId)
          convenience method to set group id.
 Params setPersistent(boolean persistent)
          convenience method to set whether JobManager should persist this job or not.
 Params setRequiresNetwork(boolean requiresNetwork)
          convenience method to set network requirement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Params

public Params(int priority)
Parameters:
priority - higher = better
Method Detail

requireNetwork

public Params requireNetwork()
Sets the Job as requiring network

Returns:
this

groupBy

public Params groupBy(java.lang.String groupId)
Sets the group id. Jobs in the same group are guaranteed to execute sequentially.

Parameters:
groupId - which group this job belongs (can be null of course)
Returns:
this

persist

public Params persist()
Marks the job as persistent. Make sure your job is serializable.

Returns:
this

delayInMs

public Params delayInMs(long delayMs)
Delays the job in given ms.

Parameters:
delayMs - .
Returns:
this

setRequiresNetwork

public Params setRequiresNetwork(boolean requiresNetwork)
convenience method to set network requirement

Parameters:
requiresNetwork - true|false
Returns:
this

setGroupId

public Params setGroupId(java.lang.String groupId)
convenience method to set group id.

Parameters:
groupId -
Returns:
this

setPersistent

public Params setPersistent(boolean persistent)
convenience method to set whether JobManager should persist this job or not.

Parameters:
persistent - true|false
Returns:
this

setDelayMs

public Params setDelayMs(long delayMs)
convenience method to set delay

Parameters:
delayMs - in ms
Returns:
this

doesRequireNetwork

public boolean doesRequireNetwork()

getGroupId

public java.lang.String getGroupId()

isPersistent

public boolean isPersistent()

getPriority

public int getPriority()

getDelayMs

public long getDelayMs()