WorkQuery

public final class WorkQuery
extends Object

java.lang.Object
   ↳ androidx.work.WorkQuery


A specification for querying WorkRequests. This is comprised of 4 components; namely ids, unique work names, tags & work states.

A List of WorkRequest ids, or a List of unique work names, or a List of WorkRequest tags, or a List of WorkInfo.State can be specified.

Each component in a WorkQuery is AND-ed with the others. Each value in a component is OR-ed.

Example: (id1 OR id2 OR ...) AND (name1 OR name2 OR ...) AND (tag1 OR tag2 OR ...) AND (state1 OR state2 OR ...)

Summary

Nested classes

class WorkQuery.Builder

A builder for WorkQuery

Public methods

static WorkQuery fromIds(List<UUID> ids)

Creates a query for WorkRequests with the given ids.

static WorkQuery fromIds(UUID... ids)

Creates a query for WorkRequests with the given ids.

static WorkQuery fromIds(UUID id)

Creates a query for WorkRequests with the given ids.

static WorkQuery fromStates(WorkInfo.State state)

Creates a WorkQuery for the workers in the given WorkInfo.State state.

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

Creates a WorkQuery for the workers in the given WorkInfo.State states.

static WorkQuery fromStates(State... states)

Creates a WorkQuery for the workers in the given WorkInfo.State states.

static