CasePathFactory

class CasePathFactory<Root>(rootType: TypeId, rootKType: KType)

A JVM-only root-scoped factory for conventional data-class CaseKeyPaths.

Obtain one with casePathsOf. pathFor reflects the referenced constructor once to locate its stored primary-constructor properties. Prefer generated catalogs for frequently used CaseKeyPaths; this convenience is intentionally isolated from kpaths-core because it needs Kotlin/JVM's full reflection implementation.

Constructors

Link copied to clipboard
constructor(rootType: TypeId, rootKType: KType)

Functions

Link copied to clipboard
fun <Case : Root, Value> pathFor(constructor: (Value) -> Case): CaseKeyPath<Root, Value>

Creates a CaseKeyPath for a unary data-class case constructor.

Creates a CaseKeyPath for a binary data-class case constructor, focused as an ordered Pair.

Creates a CaseKeyPath for a ternary data-class case constructor, focused as an ordered Triple.