elementAt

fun JsonElement.elementAt(pointer: KPointer): JsonElement?(source)

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

Equivalent to get (the operator form) but available under a non-operator name so a String overload can also be exposed without colliding with Map.get on JsonObject.

Return

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

Parameters

pointer

The KPointer identifying the value to retrieve.


fun JsonElement.elementAt(path: String): JsonElement?(source)

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

Return

The JsonElement 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.