BackoffPolicy
public enum BackoffPolicy extends 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 methods |
|
|---|---|
final @NonNull EnumEntries<@NonNull BackoffPolicy> |
Returns a representation of an immutable list of all enum entries, in the order they're declared. |
final @NonNull BackoffPolicy |
Returns the enum constant of this type with the specified name. |
final @NonNull BackoffPolicy[] |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Enum Values
EXPONENTIAL
BackoffPolicy BackoffPolicy.EXPONENTIAL
Used to indicate that WorkManager should increase the backoff time exponentially
LINEAR
BackoffPolicy BackoffPolicy.LINEAR
Used to indicate that WorkManager should increase the backoff time linearly
Public methods
getEntries
public final @NonNull EnumEntries<@NonNull BackoffPolicy> 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 BackoffPolicy 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 |