KpaStruct

Read-only view of an object-shaped structure addressable by string keys.

Implementations must be able to materialize themselves into a Map snapshot and expose a KpaElementFactory that knows how to rebuild a fresh instance from that snapshot.

Inheritors

Properties

Link copied to clipboard

The factory that knows how to produce primitives and rebuild structs/lists in this adapter family.

Link copied to clipboard
abstract val keys: Set<String>

The set of keys present in this struct.

Functions

Link copied to clipboard
abstract operator fun contains(key: String): Boolean

Returns whether key is present in this struct.

Link copied to clipboard
abstract operator fun get(key: String): KpaElement?

Returns the value associated with key, or null if absent.

Link copied to clipboard
operator fun KpaStruct.get(pointer: KPointer): KpaElement?

Returns the KpaElement at the path identified by pointer, or null if a key along the path is absent. Returns the receiver if pointer is the root pointer.

Link copied to clipboard

Creates a new KpaStruct by applying pointer-based mutations within block.

Link copied to clipboard
abstract fun toMap(): Map<String, KpaElement>

Returns a snapshot of this struct as a plain Map.