Configuration.Builder

public static final class Configuration.Builder
extends Object

java.lang.Object
   ↳ androidx.work.Configuration.Builder


A Builder for Configurations.

Summary

Public constructors

Builder()

Creates a new Configuration.Builder.

Public methods

Configuration build()

Builds a Configuration object.

Configuration.Builder setDefaultProcessName(String processName)

Designates the primary process that WorkManager should schedule work in.

Configuration.Builder setExecutor(Executor executor)

Specifies a custom Executor for WorkManager.

Configuration.Builder setInputMergerFactory(InputMergerFactory inputMergerFactory)

Specifies a custom InputMergerFactory for WorkManager.

Configuration.Builder setJobSchedulerJobIdRange(int minJobSchedulerId, int maxJobSchedulerId)

Specifies the range of JobInfo IDs that can be used by WorkManager.

Configuration.Builder setMaxSchedulerLimit(int maxSchedulerLimit)

Specifies the maximum number of system requests made by WorkManager when using JobScheduler or AlarmManager.

Configuration.Builder setMinimumLoggingLevel(int loggingLevel)

Specifies the minimum logging level, corresponding to the constants found in Log.

Configuration.Builder setRunnableScheduler(RunnableScheduler runnableScheduler)

Specifies the RunnableScheduler to be used by WorkManager.

Configuration.Builder setTaskExecutor(Executor taskExecutor)

Specifies a Executor which will be used by WorkManager for all its internal book-keeping.

Configuration.Builder setWorkerFactory(WorkerFactory workerFactory)

Specifies a custom WorkerFactory for WorkManager.

Inherited methods

Public constructors

Builder

public Builder ()

Creates a new Configuration.Builder.

Public methods

build

public Configuration build ()

Builds a Configuration object.

Returns
Configuration A Configuration object with this Configuration.Builder's parameters.

setDefaultProcessName

public Configuration.Builder setDefaultProcessName (String processName)

Designates the primary process that WorkManager should schedule work in.

Parameters
processName String: The String process name.

Returns
Configuration.Builder This Configuration.Builder instance

setExecutor

public Configuration.Builder setExecutor (Executor executor)

Specifies a custom Executor for WorkManager.

Parameters
executor Executor: An Executor for running Workers

Returns
Configuration.Builder This Configuration.Builder instance

setInputMergerFactory

public Configuration.Builder setInputMergerFactory (InputMergerFactory inputMergerFactory)

Specifies a custom InputMergerFactory for WorkManager.

Parameters
inputMergerFactory InputMergerFactory: A InputMergerFactory for creating InputMergers

Returns
Configuration.Builder This Configuration.Builder instance

setJobSchedulerJobIdRange

public Configuration.Builder setJobSchedulerJobIdRange (int minJobSchedulerId, 
                int maxJobSchedulerId)

Specifies the range of JobInfo IDs that can be used by