public final class

OneTimeWorkRequest.Builder

extends WorkRequest.Builder<OneTimeWorkRequest.Builder, OneTimeWorkRequest>

 java.lang.Object

androidx.work.WorkRequest.Builder<OneTimeWorkRequest.Builder, OneTimeWorkRequest>

↳androidx.work.OneTimeWorkRequest.Builder

Overview

Builder for OneTimeWorkRequests.

Summary

Constructors
publicBuilder(java.lang.Class<ListenableWorker> workerClass)

Creates a OneTimeWorkRequest.

Methods
public OneTimeWorkRequest.BuildersetInputMerger(java.lang.Class<InputMerger> inputMerger)

Specifies the InputMerger class name for this OneTimeWorkRequest.

from WorkRequest.Builder<B, W>addTag, build, keepResultsForAtLeast, keepResultsForAtLeast, setBackoffCriteria, setBackoffCriteria, setConstraints, setExpedited, setInitialDelay, setInitialDelay, setInitialRunAttemptCount, setInitialState, setInputData, setLastEnqueueTime, setScheduleRequestedAt
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.Class<ListenableWorker> workerClass)

Creates a OneTimeWorkRequest.

Parameters:

workerClass: The ListenableWorker class to run for this work

Methods

public OneTimeWorkRequest.Builder setInputMerger(java.lang.Class<InputMerger> inputMerger)

Specifies the InputMerger class name for this OneTimeWorkRequest.

Before workers run, they receive input Data from their parent workers, as well as anything specified directly to them via WorkRequest.Builder.setInputData(Data). An InputMerger takes all of these objects and converts them to a single merged Data to be used as the worker input. The default InputMerger is OverwritingInputMerger. This library also offers ArrayCreatingInputMerger; you can also specify your own.

Parameters:

inputMerger: The class name of the InputMerger for this OneTimeWorkRequest

Returns:

The current OneTimeWorkRequest.Builder