NetworkType
enum NetworkType : Enum
An enumeration of various network types that can be used as Constraints for work.
Summary
Enum Values |
|
|---|---|
CONNECTED |
Any working network connection is required for this work. |
METERED |
A metered network connection is required for this work. |
NOT_REQUIRED |
A network is not required for this work. |
NOT_ROAMING |
A non-roaming network connection is required for this work. |
TEMPORARILY_UNMETERED |
A temporarily unmetered Network. |
UNMETERED |
An unmetered network connection is required for this work. |
Public functions |
|
|---|---|
NetworkType |
Returns the enum constant of this type with the specified name. |
Array<NetworkType> |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Public properties |
|
|---|---|
EnumEntries<NetworkType> |
Returns a representation of an immutable list of all enum entries, in the order they're declared. |
Enum Values
CONNECTED
val NetworkType.CONNECTED: NetworkType
Any working network connection is required for this work.
METERED
val NetworkType.METERED: NetworkType
A metered network connection is required for this work.
NOT_ROAMING
val NetworkType.NOT_ROAMING: NetworkType
A non-roaming network connection is required for this work.
TEMPORARILY_UNMETERED
val NetworkType.TEMPORARILY_UNMETERED: NetworkType
A temporarily unmetered Network. This capability will be set for networks that are generally metered, but are currently unmetered.
Note: This capability can be changed at any time. When it is removed, ListenableWorkers are responsible for stopping any data transfer that should not occur on a metered network.
UNMETERED
val NetworkType.UNMETERED: NetworkType
An unmetered network connection is required for this work.
Public functions
valueOf
fun valueOf(value: String): NetworkType
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<NetworkType>
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.
Public properties
entries
val entries: EnumEntries<NetworkType>
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.