public class

WorkerWrapper.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.work.impl.WorkerWrapper.Builder

Overview

Builder class for WorkerWrapper

Summary

Constructors
publicBuilder(Context context, Configuration configuration, TaskExecutor workTaskExecutor, ForegroundProcessor foregroundProcessor, WorkDatabase database, java.lang.String workSpecId)

Methods
public WorkerWrapperbuild()

public WorkerWrapper.BuilderwithRuntimeExtras(WorkerParameters.RuntimeExtras runtimeExtras)

public WorkerWrapper.BuilderwithSchedulers(java.util.List<Scheduler> schedulers)

public WorkerWrapper.BuilderwithWorker(ListenableWorker worker)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Context context, Configuration configuration, TaskExecutor workTaskExecutor, ForegroundProcessor foregroundProcessor, WorkDatabase database, java.lang.String workSpecId)

Methods

public WorkerWrapper.Builder withSchedulers(java.util.List<Scheduler> schedulers)

Parameters:

schedulers: The list of Schedulers used for scheduling Workers.

Returns:

The instance of WorkerWrapper.Builder for chaining.

public WorkerWrapper.Builder withRuntimeExtras(WorkerParameters.RuntimeExtras runtimeExtras)

Parameters:

runtimeExtras: The for the Worker; if this is null, it will be ignored and the default value will be retained.

Returns:

The instance of WorkerWrapper.Builder for chaining.

public WorkerWrapper.Builder withWorker(ListenableWorker worker)

Parameters:

worker: The instance of ListenableWorker to be executed by WorkerWrapper. Useful in the context of testing.

Returns:

The instance of WorkerWrapper.Builder for chaining.

public WorkerWrapper build()

Returns:

The instance of WorkerWrapper.