Builder

class Builder : WorkRequest.Builder<OneTimeWorkRequest.Builder!, OneTimeWorkRequest!>
kotlin.Any
   ↳ androidx.work.WorkRequest.Builder<androidx.work.OneTimeWorkRequest.Builder, androidx.work.OneTimeWorkRequest>
   ↳ androidx.work.OneTimeWorkRequest.Builder

Builder for OneTimeWorkRequest class.

Summary

Public constructors
<init>(workerClass: Class<out Worker!>)

Public methods
OneTimeWorkRequest.Builder!
setInitialDelay(duration: Long, timeUnit: TimeUnit)

Add an initial delay to the OneTimeWorkRequest.

OneTimeWorkRequest.Builder!

Add an initial delay to the OneTimeWorkRequest.

OneTimeWorkRequest.Builder!
setInputMerger(inputMerger: Class<out InputMerger!>)

Specify the InputMerger class name for this OneTimeWorkRequest.

OneTimeWorkRequest!

Inherited functions
Extension functions
From androidx.work
OneTimeWorkRequest.Builder!

Sets an InputMerger on the OneTimeWorkRequest.Builder.

From androidx.work.ktx
OneTimeWorkRequest.Builder!

Public constructors

<init>

Builder(workerClass: Class<out Worker!>)

Public methods

setInitialDelay

fun setInitialDelay(duration: Long, timeUnit: TimeUnit): OneTimeWorkRequest.Builder!

Add an initial delay to the OneTimeWorkRequest.

Parameters
duration Long: The length of the delay in timeUnit units
timeUnit Long: The units of time for duration
Return
OneTimeWorkRequest.Builder!: The current Builder

setInitialDelay

fun setInitialDelay(duration: Duration!): OneTimeWorkRequest.Builder!

Add an initial delay to the OneTimeWorkRequest.

Parameters
duration Duration!: The length of the delay
Return
OneTimeWorkRequest.Builder!: The current Builder

setInputMerger

fun setInputMerger(inputMerger: Class<out InputMerger!>): OneTimeWorkRequest.Builder!

Specify the InputMerger class name for this OneTimeWorkRequest. An InputMerger takes one or more Data inputs to a Worker and converts them to a single merged Data to be used as its input. The default InputMerger is OverwritingInputMerger.

Parameters
inputMerger Class<out InputMerger!>: The class name of the InputMerger for this OneTimeWorkRequest
Return
OneTimeWorkRequest.Builder!: The current Builder

build

fun build(): OneTimeWorkRequest!