getOrDefaultNullifyingDelete

inline fun <T : Any> PatchOp<T>.getOrDefaultNullifyingDelete(current: () -> T?): T?

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

  • set - If the patch is a set, the new value will be returned.

  • delete - If the patch is a delete, null will be returned.

  • none - If the patch is none, the value returned by current will be returned.

Return

Value depending on the patch operation.

Parameters

current

Value to be returned when the patch operation is none.