UpdateOp

interface UpdateOp<T : Any>

JSON Merge Patch update operations: none, set

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
inline fun <T : Any> UpdateOp<T>.getOrDefault(current: () -> T): T

Retrieves a value depending on the patch operation where none is mapped to the value returned by given the current function.

Link copied to clipboard
inline fun <T : Any, R : Any> UpdateOp<T>.map(transform: (T) -> R): UpdateOp<R>

Transforms the value for set operations by calling the provided transform function and creating a new set operation; none operations are returned as is.

Link copied to clipboard
inline fun <T : Any> UpdateOp<T>.use(block: (T) -> Unit)

Allows using a patch update operation by passing an appropriate value to the given block function.