NetworkType
public enum NetworkType extends 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 methods |
|
|---|---|
final @NonNull EnumEntries<@NonNull NetworkType> |
Returns a representation of an immutable list of all enum entries, in the order they're declared. |
final @NonNull NetworkType |
Returns the enum constant of this type with the specified name. |
final @NonNull NetworkType[] |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Enum Values
CONNECTED
NetworkType NetworkType.CONNECTED
Any working network connection is required for this work.
NOT_ROAMING
NetworkType NetworkType.NOT_ROAMING
A non-roaming network connection is required for this work.
TEMPORARILY_UNMETERED
NetworkType NetworkType.TEMPORARILY_UNMETERED
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
NetworkType NetworkType.UNMETERED
An unmetered network connection is required for this work.
Public methods
getEntries
public final @NonNull EnumEntries<@NonNull NetworkType> getEntries()
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.
valueOf
public final @NonNull NetworkType valueOf(@NonNull String value)
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 |