WorkerParameters

class WorkerParameters
kotlin.Any
   ↳ androidx.work.WorkerParameters

Setup parameters for a ListenableWorker.

Summary

Public methods
UUID

Gets the ID of the WorkRequest that created this ListenableWorker.

Data

Gets the input data.

Network?

Gets the android.net.Network to use for this Worker.

Int

Gets the current run attempt count for this work.

MutableSet<String!>

Gets a java.util.Set of tags associated with this Worker's WorkRequest.

MutableList<String!>

Gets the list of content authorities that caused this Worker to execute.

MutableList<Uri!>

Gets the list of content android.net.Uris that caused this Worker to execute.

Public methods

getId

@NonNull fun getId(): UUID

Gets the ID of the WorkRequest that created this ListenableWorker.

Return
UUID: The ID of the creating WorkRequest

getInputData

@NonNull fun getInputData(): Data

Gets the input data. Note that in the case that there are multiple prerequisites for this ListenableWorker, the input data has been run through an InputMerger.

Return
Data: The input data for this work

getNetwork

@Nullable fun getNetwork(): Network?

Gets the android.net.Network to use for this Worker. This method returns null if there is no network needed for this work request.

Return
Network?: The android.net.Network specified by the OS to be used with this Worker

getRunAttemptCount

fun getRunAttemptCount(): Int

Gets the current run attempt count for this work. Note that for periodic work, this value gets reset between periods.

Return
Int: The current run attempt count for this work.

getTags

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

Gets a java.util.Set of tags associated with this Worker's WorkRequest.

Return
MutableSet<String!>: The java.util.Set of tags associated with this Worker's WorkRequest

getTriggeredContentAuthorities

@NonNull fun getTriggeredContentAuthorities(): MutableList<String!>

Gets the list of content authorities that caused this Worker to execute. See JobParameters#getTriggeredContentAuthorities() for relevant JobScheduler code.

Return
MutableList<String!>: The list of content authorities that caused this Worker to execute

getTriggeredContentUris

@NonNull fun getTriggeredContentUris(): MutableList<Uri!>

Gets the list of content android.net.Uris that caused this Worker to execute. See

Return
MutableList<Uri!>: The list of content android.net.Uris that caused this Worker to execute