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

get

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

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


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

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

Generated by Dokka
(c) Tealium 2026