YamlMapAdapter

Adapter exposing a YamlMap as a RebuildableKpaStruct.

YAML maps may contain non-string (compound) keys; this adapter exposes only entries whose key is a YamlLiteral. Entries with compound keys remain reachable via the backing property.

com.commonsware.kpointer.adapter.AbstractKpaStructMap is not used here because YamlMap keys are YamlElements rather than Strings, so key lookup and enumeration must be implemented directly.

Parameters

backing

The underlying YamlMap.

Constructors

Link copied to clipboard
constructor(backing: YamlMap)

Properties

Link copied to clipboard
open override val backing: YamlMap
Link copied to clipboard
open override val factory: KpaElementFactory
Link copied to clipboard
open override val keys: Set<String>

The set of literal-string keys in backing. Compound keys are filtered out.

Functions

Link copied to clipboard
open operator override fun contains(key: String): Boolean
Link copied to clipboard
open operator override fun get(key: String): KpaElement?
Link copied to clipboard
open override fun toMap(): Map<String, KpaElement>
Link copied to clipboard
fun toYamlElement(): YamlElement

Returns the YamlMap backing this adapter as a YamlElement.

Link copied to clipboard
fun KpaElement.toYamlElement(): YamlElement

Returns the YamlElement backing this adapter, or throws if this is not a YamlElementAdapter.