Register now for Android Dev Summit 2019!

WorkInfo

class WorkInfo
kotlin.Any
   ↳ androidx.work.WorkInfo

Information about a particular WorkRequest containing the id of the WorkRequest, its current State, output, tags, and run attempt count. Note that output is only available for the terminal states (State#SUCCEEDED and State#FAILED).

Summary

Nested classes

The current lifecycle state of a WorkRequest.

Public methods

Boolean
equals(other: Any?)

UUID

Gets the identifier of the WorkRequest.

Data

Gets the output Data for the WorkRequest.

Int

Gets the run attempt count of the WorkRequest.

WorkInfo.State

Gets the current State of the WorkRequest.

MutableSet<String!>

Gets the Set of tags associated with the WorkRequest.

Int

String

Public methods

equals

fun equals(other: Any?): Boolean

getId

@NonNull fun getId(): UUID

Gets the identifier of the WorkRequest.

Return
UUID: The identifier of a WorkRequest

getOutputData

@NonNull fun getOutputData(): Data

Gets the output Data for the WorkRequest. If the WorkRequest is unfinished, this is always Data#EMPTY.

Return
Data: The output Data of the WorkRequest

getRunAttemptCount

fun getRunAttemptCount(): Int

Gets the run attempt count of the WorkRequest. Note that for PeriodicWorkRequests, the run attempt count gets reset between successful runs.

Return
Int: The run attempt count of the WorkRequest.

getState

@NonNull fun getState(): WorkInfo.State

Gets the current State of the WorkRequest.

Return
WorkInfo.State: The current State of the WorkRequest

getTags

@NonNull fun getTags(): MutableSet<String!>

Gets the Set of tags associated with the WorkRequest.

Return
MutableSet<String!>: The Set of tags associated with the WorkRequest

hashCode

fun hashCode(): Int

toString

fun toString(): String