public static final class Job.Builder extends java.lang.Object implements JobParameters
Job. Retrieved by calling FirebaseJobDispatcher.newJobBuilder().| Modifier and Type | Method and Description |
|---|---|
Job.Builder |
addConstraint(int constraint)
Adds the provided constraint to the current list of runtime constraints.
|
Job |
build()
Builds the Job, using the settings provided so far.
|
int[] |
getConstraints()
The runtime constraints applied to this Job.
|
android.os.Bundle |
getExtras()
The optional set of user-supplied extras associated with this Job.
|
int |
getLifetime()
The Job's lifetime; how long it should persist for.
|
RetryStrategy |
getRetryStrategy()
The RetryStrategy for the Job.
|
java.lang.String |
getService()
Returns the name of the backing JobService class.
|
java.lang.String |
getTag()
Returns a string identifier for the Job.
|
JobTrigger |
getTrigger()
The Job's Trigger, which decides when the Job is ready to run.
|
TriggerReason |
getTriggerReason() |
boolean |
isRecurring()
Whether the Job should repeat.
|
Job.Builder |
setConstraints(int... constraints)
Sets the Job's runtime constraints.
|
Job.Builder |
setExtras(android.os.Bundle extras)
Sets the user-defined extras associated with the Job.
|
Job.Builder |
setLifetime(int lifetime)
Sets the Job's lifetime, or how long it should persist.
|
Job.Builder |
setRecurring(boolean recurring)
Sets whether the job should recur.
|
Job.Builder |
setReplaceCurrent(boolean replaceCurrent)
Sets whether this Job should replace pre-existing Jobs with the same tag.
|
Job.Builder |
setRetryStrategy(RetryStrategy retryStrategy)
Set the RetryStrategy used for the Job.
|
Job.Builder |
setService(java.lang.Class<? extends JobService> serviceClass)
Sets the backing JobService class for the Job.
|
Job.Builder |
setTag(java.lang.String tag)
Sets the unique String tag used to identify the Job.
|
Job.Builder |
setTrigger(JobTrigger trigger)
Sets the Trigger used for the Job.
|
boolean |
shouldReplaceCurrent()
Whether the Job should replace a pre-existing Job with the same tag.
|
public Job.Builder addConstraint(int constraint)
public Job.Builder setReplaceCurrent(boolean replaceCurrent)
public Job build()
public java.lang.String getService()
getService in interface JobParameterspublic Job.Builder setService(java.lang.Class<? extends JobService> serviceClass)
getService().public java.lang.String getTag()
getTag in interface JobParameterspublic Job.Builder setTag(java.lang.String tag)
getTag().public JobTrigger getTrigger()
getTrigger in interface JobParameterspublic Job.Builder setTrigger(JobTrigger trigger)
getTrigger().public int getLifetime()
getLifetime in interface JobParameterspublic Job.Builder setLifetime(int lifetime)
getLifetime().public boolean isRecurring()
isRecurring in interface JobParameterspublic Job.Builder setRecurring(boolean recurring)
public int[] getConstraints()
getConstraints in interface JobParameterspublic Job.Builder setConstraints(int... constraints)
getConstraints().public android.os.Bundle getExtras()
getExtras in interface JobParameterspublic Job.Builder setExtras(android.os.Bundle extras)
getExtras().public RetryStrategy getRetryStrategy()
getRetryStrategy in interface JobParameterspublic Job.Builder setRetryStrategy(RetryStrategy retryStrategy)
getRetryStrategy().public boolean shouldReplaceCurrent()
shouldReplaceCurrent in interface JobParameterspublic TriggerReason getTriggerReason()
getTriggerReason in interface JobParametersTriggerReason that - if non null - describes why the job was triggered.