/** * Creates a new instance to build a {@link JobRequest}. Note that the {@code tag} doesn't * need to be unique. Each created request has an unique ID to differentiate between jobs * with the same tag. * * <br> * <br> * * When your job is about to start you receive a callback in your {@link JobCreator} to create * a {@link Job} for this {@code tag}. * * @param tag The tag is used to identify your {@code Job} in {@link JobCreator#create(String)}. */ public Builder(@NonNull String tag) { mTag = JobPreconditions.checkNotEmpty(tag); mId = CREATE_ID; mStartMs = -1; mEndMs = -1; mBackoffMs = DEFAULT_BACKOFF_MS; mBackoffPolicy = DEFAULT_BACKOFF_POLICY; mNetworkType = DEFAULT_NETWORK_TYPE; }
JobPreconditions.checkNotEmpty(mTag); JobPreconditions.checkArgumentPositive(mBackoffMs, "backoffMs must be > 0"); JobPreconditions.checkNotNull(mBackoffPolicy);
/** * Creates a new instance to build a {@link JobRequest}. Note that the {@code tag} doesn't * need to be unique. Each created request has an unique ID to differentiate between jobs * with the same tag. * * <br> * <br> * * When your job is about to start you receive a callback in your {@link JobCreator} to create * a {@link Job} for this {@code tag}. * * @param tag The tag is used to identify your {@code Job} in {@link JobCreator#create(String)}. */ public Builder(@NonNull String tag) { mTag = JobPreconditions.checkNotEmpty(tag); mId = CREATE_ID; mStartMs = -1; mEndMs = -1; mBackoffMs = DEFAULT_BACKOFF_MS; mBackoffPolicy = DEFAULT_BACKOFF_POLICY; mNetworkType = DEFAULT_NETWORK_TYPE; }
JobPreconditions.checkNotEmpty(mTag); JobPreconditions.checkArgumentPositive(mBackoffMs, "backoffMs must be > 0"); JobPreconditions.checkNotNull(mBackoffPolicy);