ExistingWorkPolicy
enum ExistingWorkPolicy : Enum
An enumeration of the conflict resolution policies available to unique OneTimeWorkRequests in case of a collision.
Summary
Enum Values |
|
|---|---|
APPEND |
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as a child of all the leaves of that work sequence. |
APPEND_OR_REPLACE |
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as the child of all the leaves of that work sequence. |
KEEP |
If there is existing pending (uncompleted) work with the same unique name, do nothing. |
REPLACE |
If there is existing pending (uncompleted) work with the same unique name, cancel and delete it. |
Public functions |
|
|---|---|
ExistingWorkPolicy |
Returns the enum constant of this type with the specified name. |
Array<ExistingWorkPolicy> |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Public properties |
|
|---|---|
EnumEntries<ExistingWorkPolicy> |
Returns an immutable |
Enum Values
APPEND
val ExistingWorkPolicy.APPEND: ExistingWorkPolicy
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as a child of all the leaves of that work sequence. Otherwise, insert the newly-specified work as the start of a new sequence.
Note: When using APPEND with failed or cancelled prerequisites, newly enqueued work will also be marked as failed or cancelled respectively. Use ExistingWorkPolicy.APPEND_OR_REPLACE to create a new chain of work.
APPEND_OR_REPLACE
val ExistingWorkPolicy.APPEND_OR_REPLACE: ExistingWorkPolicy
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as the child of all the leaves of that work sequence. Otherwise, insert the newly-specified work as the start of a new sequence.
Note: If there are failed or cancelled prerequisites, these prerequisites are dropped and the newly-specified work is the start of a new sequence.
KEEP
val ExistingWorkPolicy.KEEP: ExistingWorkPolicy
If there is existing pending (uncompleted) work with the same unique name, do nothing. Otherwise, insert the newly-specified work.
REPLACE
val ExistingWorkPolicy.REPLACE: ExistingWorkPolicy
If there is existing pending (uncompleted) work with the same unique name, cancel and delete it. Then, insert the newly-specified work.
Public functions
valueOf
fun valueOf(value: String): ExistingWorkPolicy
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<ExistingWorkPolicy>
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.
The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using entries property as a more efficient alternative returning an immutable list of enum entries.
Public properties
entries
val entries: EnumEntries<ExistingWorkPolicy>
Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.