setOrDelete

fun <T : Any> setOrDelete(value: T?): PatchOp<T>

Creates a JSON Merge Patch set or delete operation from the provided value. If the value provided is not null a set operation is created to set/replace the current value. Alternatively, when the provided value is null a delete operation is created to delete the current value.

Return

PatchOp.Set or PatchOp.Delete operation instance.

Parameters

value

Value to set/replace the current value or delete the current value.