lightbulb_outline Please take our October 2018 developer survey. Start survey

WorkerParameters

public final class WorkerParameters
extends Object

java.lang.Object
   ↳ androidx.work.WorkerParameters


Setup parameters for a Worker.

Summary

Public methods

UUID getId()

Gets the ID of the WorkRequest that created this Worker.

Data getInputData()

Gets the input data.

Network getNetwork()

Gets the Network to use for this Worker.

int getRunAttemptCount()

Gets the current run attempt count for this work.

Set<String> getTags()

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

String[] getTriggeredContentAuthorities()

Gets the array of content authorities that caused this Worker to execute

Uri[] getTriggeredContentUris()

Gets the array of content Uris that caused this Worker to execute

Inherited methods

Public methods

getId

public UUID getId ()

Gets the ID of the WorkRequest that created this Worker.

Returns
UUID The ID of the creating WorkRequest

getInputData

public Data getInputData ()

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

Returns
Data The input data for this work

getNetwork

public Network getNetwork ()

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

Returns
Network The Network specified by the OS to be used with this Worker

getRunAttemptCount

public int getRunAttemptCount ()

Gets the current run attempt count for this work.

Returns
int The current run attempt count for this work.

getTags

public Set<String> getTags ()

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

Returns
Set<String> The Set of tags associated with this Worker's WorkRequest

getTriggeredContentAuthorities

public String[] getTriggeredContentAuthorities ()

Gets the array of content authorities that caused this Worker to execute

Returns
String[] The array of content authorities that caused this Worker to execute

getTriggeredContentUris

public Uri[] getTriggeredContentUris ()

Gets the array of content Uris that caused this Worker to execute

Returns
Uri[] The array of content Uris that caused this Worker to execute