primitiveAt

fun YamlElement.primitiveAt(pointer: KPointer): YamlPrimitive?(source)

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

Accepts net.mamoe.yamlkt.YamlNull, which is a YamlPrimitive.

Return

The YamlPrimitive at the specified path, or null if absent.

Parameters

pointer

The KPointer identifying the value to retrieve.

Throws

if the value at pointer exists but is not a YamlPrimitive.


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

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

Return

The YamlPrimitive at the specified path, or null if absent.

Parameters

path

A pointer string (RFC 6901, fragment, or dot-notation, dispatched by prefix).

Throws

if path is not a valid pointer string, or if the value at path exists but is not a YamlPrimitive.