BackedKpaElement

interface BackedKpaElement<out B : Any> : KpaElement(source)

Marker interface for KpaElement adapters that wrap a native backing element of type B.

Adapter families that use a sealed native element hierarchy (e.g. JsonElement, YamlElement) declare a family-specific interface that extends this one and narrows B to the root of that hierarchy. The requireBacking helper then provides a concise, single-expression body for adapter-family toXxxElement() extension functions.

Type Parameters

B

The type of the native backing element. Must be non-null.

Properties

Link copied to clipboard
abstract val backing: B

The native backing element wrapped by this adapter.

Functions

Link copied to clipboard
inline fun <B : Any> KpaElement.requireBacking(libraryName: String): B

Unwraps this KpaElement to its native backing value of type B, or throws if this element is not a BackedKpaElement whose backing is of type B.