WorkQuery
public final class 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 types |
|---|
public final class WorkQuery.BuilderA builder for |
Public methods |
|
|---|---|
static final @NonNull WorkQuery |
Creates a query for |
static final @NonNull WorkQuery |
Creates a query for |
static final @NonNull WorkQuery |
fromStates(@NonNull List<@NonNull WorkInfo.State> states)Creates a |
static final @NonNull WorkQuery |
fromStates(@NonNull WorkInfo.State... states)Creates a |
static final @NonNull WorkQuery |
Creates a query for |
static final @NonNull WorkQuery |
Creates a query for |
static final @NonNull WorkQuery |
fromUniqueWorkNames(@NonNull List<@NonNull String> uniqueWorkNames)Creates a query for |
static final @NonNull WorkQuery |
fromUniqueWorkNames(@NonNull String... uniqueWorkNames)Creates a query for |
final @NonNull List<@NonNull UUID> |
getIds()The |
final @NonNull List<@NonNull WorkInfo.State> |
The |
final @NonNull List<@NonNull String> |
getTags()The |
final @NonNull List<@NonNull String> |
The |
Public methods
fromIds
public static final @NonNull WorkQuery fromIds(@NonNull List<@NonNull UUID> ids)
Creates a query for WorkRequests with the given ids.
| Parameters | |
|---|---|
@NonNull List<@NonNull UUID> ids |
list of ids of |
fromIds
public static final @NonNull WorkQuery fromIds(@NonNull UUID... ids)
Creates a query for WorkRequests with the given ids.
| Parameters | |
|---|---|
@NonNull UUID... ids |
ids of |
fromStates
public static final @NonNull WorkQuery fromStates(@NonNull List<@NonNull WorkInfo.State> states)
Creates a WorkQuery for the workers in the given WorkInfo.State states.
| Parameters | |
|---|---|
@NonNull List<@NonNull WorkInfo.State> states |
The |
fromStates
public static final @NonNull WorkQuery fromStates(@NonNull WorkInfo.State... states)
Creates a WorkQuery for the workers in the given WorkInfo.State states.
| Parameters | |
|---|---|
@NonNull WorkInfo.State... states |
states of workers |
fromTags
public static final @NonNull WorkQuery fromTags(@NonNull List<@NonNull String> tags)
Creates a query for WorkRequests with the given tags.
| Parameters | |
|---|---|
@NonNull List<@NonNull String> tags |
tags of |
fromTags
public static final @NonNull WorkQuery fromTags(@NonNull String... tags)
Creates a query for WorkRequests with the given tags.
| Parameters | |
|---|---|
@NonNull String... tags |
tags of |
fromUniqueWorkNames
public static final @NonNull WorkQuery fromUniqueWorkNames(@NonNull List<@NonNull String> uniqueWorkNames)
Creates a query for WorkRequests with the given unique names.
fromUniqueWorkNames
public static final @NonNull WorkQuery fromUniqueWorkNames(@NonNull String... uniqueWorkNames)
Creates a query for WorkRequests with the given unique names.
getIds
public final @NonNull List<@NonNull UUID> getIds()
The List of WorkRequest ids being queried.
getStates
public final @NonNull List<@NonNull WorkInfo.State> getStates()
The List of WorkInfo.States being queried