WorkInfo.State
public enum WorkInfo.State extends Enum
The current lifecycle state of a WorkRequest.
Summary
Enum Values |
|
|---|---|
BLOCKED |
Used to indicate that the |
CANCELLED |
Used to indicate that the |
ENQUEUED |
Used to indicate that the |
FAILED |
Used to indicate that the |
RUNNING |
Used to indicate that the |
SUCCEEDED |
Used to indicate that the |
Public methods |
|
|---|---|
final @NonNull EnumEntries<@NonNull WorkInfo.State> |
The current lifecycle state of a |
final boolean |
Returns |
final @NonNull WorkInfo.State |
Returns the enum constant of this type with the specified name. |
final @NonNull WorkInfo.State[] |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Enum Values
BLOCKED
WorkInfo.State WorkInfo.State.BLOCKED
Used to indicate that the WorkRequest is currently blocked because its prerequisites haven't finished successfully.
CANCELLED
WorkInfo.State WorkInfo.State.CANCELLED
Used to indicate that the WorkRequest has been cancelled and will not execute. All dependent work will also be marked as #CANCELLED and will not run.
ENQUEUED
WorkInfo.State WorkInfo.State.ENQUEUED
Used to indicate that the WorkRequest is enqueued and eligible to run when its Constraints are met and resources are available.
FAILED
WorkInfo.State WorkInfo.State.FAILED
Used to indicate that the WorkRequest has completed in a failure state. All dependent work will also be marked as #FAILED and will never run.
RUNNING
WorkInfo.State WorkInfo.State.RUNNING
Used to indicate that the WorkRequest is currently being executed.
SUCCEEDED
WorkInfo.State WorkInfo.State.SUCCEEDED
Used to indicate that the WorkRequest has completed in a successful state. Note that PeriodicWorkRequests will never enter this state (they will simply go back to .ENQUEUED and be eligible to run again).
Public methods
getEntries
public final @NonNull EnumEntries<@NonNull WorkInfo.State> getEntries()
The current lifecycle state of a WorkRequest.
isFinished
public final boolean isFinished()
Returns true if this State is considered finished: .SUCCEEDED, .FAILED, and * .CANCELLED
valueOf
public final @NonNull WorkInfo.State valueOf(@NonNull String value)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if this enum type has no constant with the specified name |