Constraints

public final class Constraints
extends Object

java.lang.Object
   ↳ androidx.work.Constraints


The constraints that can be applied to one WorkRequest.

Summary

Nested classes

class Constraints.Builder

Builder for Constraints class. 

Fields

public static final Constraints NONE

Public constructors

Constraints()

Public methods

boolean equals(Object o)
ContentUriTriggers getContentUriTriggers()
NetworkType getRequiredNetworkType()
boolean hasContentUriTriggers()
int hashCode()
boolean requiresBatteryNotLow()
boolean requiresCharging()
boolean requiresDeviceIdle()
boolean requiresStorageNotLow()
void setContentUriTriggers(ContentUriTriggers mContentUriTriggers)
void setRequiredNetworkType(NetworkType requiredNetworkType)
void setRequiresBatteryNotLow(boolean requiresBatteryNotLow)
void setRequiresCharging(boolean requiresCharging)
void setRequiresDeviceIdle(boolean requiresDeviceIdle)
void setRequiresStorageNotLow(boolean requiresStorageNotLow)

Inherited methods

Fields

NONE

Constraints NONE

Public constructors

Constraints

Constraints ()

Public methods

equals

boolean equals (Object o)

Parameters
o Object

Returns
boolean

getContentUriTriggers

ContentUriTriggers getContentUriTriggers ()

Returns
ContentUriTriggers

getRequiredNetworkType

NetworkType getRequiredNetworkType ()

Returns
NetworkType

hasContentUriTriggers

boolean hasContentUriTriggers ()

Returns
boolean true if ContentUriTriggers is not empty

hashCode

int hashCode ()

Returns
int

requiresBatteryNotLow

boolean requiresBatteryNotLow ()

Returns
boolean If the constraints require battery not low status.

requiresCharging

boolean requiresCharging ()

Returns
boolean If the constraints require charging.

requiresDeviceIdle

boolean requiresDeviceIdle ()

Returns
boolean If the constraints require device idle.

requiresStorageNotLow

boolean requiresStorageNotLow ()

Returns
boolean If the constraints require storage not low status.

setContentUriTriggers

void setContentUriTriggers (ContentUriTriggers mContentUriTriggers)

Parameters
mContentUriTriggers ContentUriTriggers

setRequiredNetworkType

void setRequiredNetworkType (NetworkType requiredNetworkType)

Parameters
requiredNetworkType NetworkType

setRequiresBatteryNotLow

void setRequiresBatteryNotLow (boolean requiresBatteryNotLow)

Parameters
requiresBatteryNotLow boolean

setRequiresCharging

void setRequiresCharging (boolean requiresCharging)

Parameters
requiresCharging boolean

setRequiresDeviceIdle

void setRequiresDeviceIdle (boolean requiresDeviceIdle)

Parameters
requiresDeviceIdle boolean

setRequiresStorageNotLow

void setRequiresStorageNotLow (boolean requiresStorageNotLow)

Parameters
requiresStorageNotLow boolean