map

inline fun <T : Any, R : Any> PatchOp<T>.map(transform: (T) -> R): PatchOp<R>

Transforms the value for set operations by calling the provided transform function and creating a new set operation; all other patch operations (delete and none) are returned as is.

Return

Transformed set operation or a passed through delete or none operation.

Parameters

transform

Function to be called for set operations to transform the value.


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.

Return

Transformed set operation or a passed through delete or none operation.

Parameters

transform

Function to be called for set operations to transform the value.