Register now for Android Dev Summit 2019!

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 OneTimeWorkRequests.

Summary

Public constructors

<init>(@NonNull workerClass: Class<out ListenableWorker!>)

Creates a OneTimeWorkRequest.

Public methods

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

Specifies the InputMerger class name for this OneTimeWorkRequest.

Inherited functions

Extension functions

From androidx.work
OneTimeWorkRequest.Builder

Sets an InputMerger on the OneTimeWorkRequest.Builder.

Public constructors

<init>

Builder(@NonNull workerClass: Class<out ListenableWorker!>)

Creates a OneTimeWorkRequest.

Parameters
workerClass Class<out ListenableWorker!>: The ListenableWorker class to run for this work

Public methods

setInputMerger

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

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 Class<out InputMerger!>: The class name of the InputMerger for this OneTimeWorkRequest
Return
OneTimeWorkRequest.Builder: The current Builder