feat: PatchOptions#nullify to nullify an option

This commit is contained in:
Sculas
2022-08-02 22:32:55 +02:00
parent 1b42f65d95
commit 371f0c4d0b
2 changed files with 17 additions and 0 deletions

View File

@@ -42,6 +42,14 @@ class PatchOptions(vararg val options: PatchOption<*>) : Iterable<PatchOption<*>
opt.value = value
}
/**
* Sets the value of a [PatchOption] to `null`.
* @param key The key of the [PatchOption].
*/
fun nullify(key: String) {
get(key).value = null
}
override fun iterator() = options.iterator()
}