BackoffPolicy
enum BackoffPolicy : Enum
An enumeration of backoff policies when retrying work. These policies are used when you have a return ListenableWorker.Result.retry from a worker to determine the correct backoff time. Backoff policies are set in WorkRequest.Builder.setBackoffCriteria or one of its variants.
Summary
Enum Values |
|
|---|---|
EXPONENTIAL |
Used to indicate that |
LINEAR |
Used to indicate that |
Public functions |
|
|---|---|
BackoffPolicy |
Returns the enum constant of this type with the specified name. |
Array<BackoffPolicy> |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Public properties |
|
|---|---|
EnumEntries<BackoffPolicy> |
Returns a representation of an immutable list of all enum entries, in the order they're declared. |
Enum Values
EXPONENTIAL
val BackoffPolicy.EXPONENTIAL: BackoffPolicy
Used to indicate that WorkManager should increase the backoff time exponentially
LINEAR
val BackoffPolicy.LINEAR: BackoffPolicy
Used to indicate that WorkManager should increase the backoff time linearly
Public functions
valueOf
fun valueOf(value: String): BackoffPolicy
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<BackoffPolicy>
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<BackoffPolicy>
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.