Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.data/JsonPath/Companion/get

get

operator fun get(name: String): JsonPath<JsonPath.Component.Key>

Kotlin convenience method to allow expressing JsonPath items in a more succinct way:

val verbosePath = JsonPath.key("key")
.index(0)
.key("sub-key")

val shortPath = JsonPath["key"][0]["sub-key"]
verbosePath == shortPath // true
Content copied to clipboard

Return

a new JsonPath with additional Component.Key added

Parameters

name

The key name used to extract the first item in the json object


operator fun get(index: Int): JsonPath<JsonPath.Component.Index>

Kotlin convenience method to allow expressing JsonPath items in a more succinct way:

val verbosePath = JsonPath.index(1)
.index(0)
.key("sub-key")

val shortPath = JsonPath[1][0]["sub-key"]
verbosePath == shortPath // true
Content copied to clipboard

Return

a new JsonPath with additional Component.Index added

Parameters

index

The index used to extract the first item in the json array

Generated by Dokka
(c) Tealium 2026