caseWhere

inline fun <R : Any> KClass<R>.caseWhere(block: CaseWhereBuilder<R>.() -> Unit): Where<R>(source)

Predicate-dispatch CASE/WHEN rooted at the entity itself when it is a sealed type. Discriminator at $[0], payload under $[1].

The receiver provides the type anchor R for inference; its identity is unused at runtime.


inline fun <T : Any, K> caseWhere(discriminator: KProperty1<T, K>, block: CaseWhereOnBuilder<T, K>.() -> Unit): Where<T>(source)

Predicate-dispatch CASE/WHEN where the discriminator is an arbitrary field (enum, string, etc.). Compile safety: the whenEq value must match the discriminator field's type.