Patch

interface Patch

Patch interface that allows easy creation of patch operations.

This interface is used by the Sunday generator to generate patch types.

Functions

Link copied to clipboard
open fun <T : Any> delete(): PatchOp.Delete<T>

Creates a JSON Merge Patch PatchOp.Delete operation that deletes the current value.

Link copied to clipboard
open fun <T : Any> none(): PatchOp.None<T>

Creates a JSON Merge Patch PatchOp.None operation that leaves the current value untouched.

Link copied to clipboard
open fun <T : Any> set(value: T): PatchOp.Set<T>

Creates a JSON Merge Patch PatchOp.Set operation from the provided value that sets/replaces the current value.

Link copied to clipboard
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.