CaseWhereBranch

class CaseWhereBranch<T : Any, V : T>(source)

Typed scope inside a whenIs<V> { ... } branch.

Exposes a narrowed with(KProperty1<V, X>) (via the with extension below) so users can only reach into the variant's own properties — with(OtherVariant::field) won't compile.

Functions

Link copied to clipboard
inline fun <T : Any, V : T, X> CaseWhereBranch<T, V>.with(prop: KProperty1<V, X>): JsonPathBuilder<T>

Reach into a property of the variant V from inside a whenIs<V> { ... } scope, producing a JsonPathBuilder rooted at the variant payload (e.g. $[1].dueAt for a sealed-root entity).

inline fun <T : Any, V : T, X> CaseWhereBranch<T, V>.with(prop: KProperty1<V, X>, noinline block: JsonPathNode<T, X>.() -> Unit): JsonPathBuilder<T>

Nested-path variant — chains then onto the variant property path.