Package-level declarations

Types

Link copied to clipboard

Common interface for all yamlkt adapters, exposing the underlying YamlElement.

Link copied to clipboard

The single KpaElementFactory shared by every yamlkt adapter.

Link copied to clipboard
class YamlListAdapter(val backing: YamlList) : YamlElementAdapter, KpaList

Adapter exposing a YamlList as a KpaList.

Link copied to clipboard
class YamlMapAdapter(val backing: YamlMap) : YamlElementAdapter, KpaStruct

Adapter exposing a YamlMap as a KpaStruct.

Link copied to clipboard
class YamlPrimitiveAdapter(val backing: YamlPrimitive) : YamlElementAdapter, KpaPrimitive

Adapter exposing a YamlPrimitive (including YamlNull) as a KpaPrimitive.

Functions

Link copied to clipboard
fun YamlList.asKpaList(): YamlListAdapter

Wraps this YamlList in a YamlListAdapter.

Link copied to clipboard

Wraps this YamlMap in a YamlMapAdapter.

Link copied to clipboard
operator fun YamlElement.contains(pointer: KPointer): Boolean

Returns whether the path identified by pointer resolves to a value within this element.

Link copied to clipboard
fun YamlElement.elementAt(pointer: KPointer): YamlElement?

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

fun YamlElement.elementAt(path: String): YamlElement?

Parses path via KPointer.from and returns the YamlElement at that path, or null if absent.

Link copied to clipboard
fun YamlElement.listAt(pointer: KPointer): YamlList?

Returns the YamlList at pointer, or null if the path is absent.

fun YamlElement.listAt(path: String): YamlList?

Parses path via KPointer.from and returns the YamlList at that path, or null if absent.

Link copied to clipboard
fun YamlElement.mapAt(pointer: KPointer): YamlMap?

Returns the YamlMap at pointer, or null if the path is absent.

fun YamlElement.mapAt(path: String): YamlMap?

Parses path via KPointer.from and returns the YamlMap at that path, or null if absent.

Link copied to clipboard
fun YamlList.mutate(block: KpaListMutationScope.() -> Unit): YamlList

Applies pointer-based mutations to this YamlList within block, returning a new YamlList.

fun YamlMap.mutate(block: KpaStructMutationScope.() -> Unit): YamlMap

Applies pointer-based mutations to this YamlMap within block, returning a new YamlMap.

Link copied to clipboard
fun YamlElement.primitiveAt(pointer: KPointer): YamlPrimitive?

Returns the YamlPrimitive at pointer, or null if the path is absent.

fun YamlElement.primitiveAt(path: String): YamlPrimitive?

Parses path via KPointer.from and returns the YamlPrimitive at that path, or null if absent.

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

Wraps this YamlElement in the appropriate YamlElementAdapter.

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

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