WorkQuery.Builder

public static final class WorkQuery.Builder
extends Object

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


A builder for WorkQuery.

Summary

Public methods

WorkQuery.Builder addStates(List<WorkInfo.State> states)

Adds a List of WorkInfo.States to the WorkQuery.

WorkQuery.Builder addTags(List<String> tags)

Adds a List of WorkRequest tag to the WorkQuery.

WorkQuery.Builder addUniqueWorkNames(List<String> uniqueWorkNames)

Adds a List of uniqueWorkNames to the WorkQuery

WorkQuery build()

Creates an instance of WorkQuery.

static WorkQuery.Builder fromStates(List<WorkInfo.State> states)

Creates a WorkQuery.Builder with a List of WorkInfo.State states.

static WorkQuery.Builder fromTags(List<String> tags)

Creates a WorkQuery.Builder with a List of WorkRequest tags.

static WorkQuery.Builder fromUniqueWorkNames(List<String> uniqueWorkNames)

Creates a WorkQuery.Builder with a List of uniqueWorkNames.

Inherited methods

Public methods

addStates

public WorkQuery.Builder addStates (List<WorkInfo.State> states)

Adds a List of WorkInfo.States to the WorkQuery.

Parameters
states List: The List of WorkInfo.States to add

Returns
WorkQuery.Builder the instance of the WorkQuery.Builder

addTags

public WorkQuery.Builder addTags (List<String> tags)

Adds a List of WorkRequest tag to the WorkQuery.

Parameters
tags List: The List of WorkRequest tags to add

Returns
WorkQuery.Builder the instance of the WorkQuery.Builder

addUniqueWorkNames

public WorkQuery.Builder addUniqueWorkNames (List<String> uniqueWorkNames)

Adds a List of uniqueWorkNames to the WorkQuery

Parameters
uniqueWorkNames List: The List of unique work names to add

Returns
WorkQuery.Builder the instance of the WorkQuery.Builder

build

public WorkQuery build ()

Creates an instance of WorkQuery.

Returns
WorkQuery the WorkQuery instance

fromStates

public static WorkQuery.Builder fromStates (List<WorkInfo.State> states)

Creates a WorkQuery.Builder with a List of WorkInfo.State states.

Parameters
states List: The List of WorkInfo.State to add to the WorkQuery

Returns
WorkQuery.Builder a WorkQuery.Builder instance

fromTags

public static WorkQuery.Builder fromTags (List<String> tags)

Creates a WorkQuery.Builder with a List of WorkRequest tags.

Parameters
tags List: The List of WorkRequest tags

Returns
WorkQuery.Builder a WorkQuery.Builder instance

fromUniqueWorkNames

public static WorkQuery.Builder fromUniqueWorkNames (List<String> uniqueWorkNames)

Creates a WorkQuery.Builder with a List of uniqueWorkNames.

Parameters
uniqueWorkNames List: The List of unique work names

Returns
WorkQuery.Builder a WorkQuery.Builder instance