setOrDelete

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

Creates a JSON Merge Patch PatchOp.Set or PatchOp.Delete operation from the provided value. If the value provided is not null a PatchOp.Set operation is created to set/replace the current value. Alternatively, when the provided value is null a PatchOp.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.