WorkInfo.State
enum WorkInfo.State : 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 functions |
|
|---|---|
WorkInfo.State |
Returns the enum constant of this type with the specified name. |
Array<WorkInfo.State> |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Public properties |
|
|---|---|
EnumEntries<WorkInfo.State> |
Returns an immutable |
Boolean |
Returns |
Enum Values
BLOCKED
val WorkInfo.State.BLOCKED: WorkInfo.State
Used to indicate that the WorkRequest is currently blocked because its prerequisites haven't finished successfully.
CANCELLED
val WorkInfo.State.CANCELLED: WorkInfo.State
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
val WorkInfo.State.ENQUEUED: WorkInfo.State
Used to indicate that the WorkRequest is enqueued and eligible to run when its Constraints are met and resources are available.
FAILED
val WorkInfo.State.FAILED: WorkInfo.State
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
val WorkInfo.State.RUNNING: WorkInfo.State
Used to indicate that the WorkRequest is currently being executed.
SUCCEEDED
val WorkInfo.State.SUCCEEDED: WorkInfo.State
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 functions
valueOf
fun valueOf(value: String): WorkInfo.State
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 |
values
fun values(): Array<WorkInfo.State>
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using entries property as a more efficient alternative returning an immutable list of enum entries.
Public properties
entries
val entries: EnumEntries<WorkInfo.State>
Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.
isFinished
val isFinished: Boolean
Returns true if this State is considered finished: .SUCCEEDED, .FAILED, and * .CANCELLED