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

Package-level declarations

Data definition

Types

DataItem
Link copied to clipboard
class DataItem : DataItemConvertible

Immutable data class for restricting the supported types that can be passed into the system.

DataItemConverter
Link copied to clipboard
fun interface DataItemConverter<T>

Classes that implement this interface should be able to reconstruct an object of type T from a given DataItem - on the assumption that the DataItem does accurately describe all components required to create a new instance of type T

DataItemConvertible
Link copied to clipboard
fun interface DataItemConvertible

Classes that implement this interface should be able to convert themselves successfully to an instance of DataItem. Typically this can be achieved by using DataItem.convert.

DataItemExtractor
Link copied to clipboard
interface DataItemExtractor : JsonPathExtractable<JsonPath.Component.Key>

Defines common read methods for getting or extracting common data types from a Map-like object containing DataItems

DataItemUtils
Link copied to clipboard
object DataItemUtils

A set of utility methods for conversions of common data types into their DataItem equivalent.

DataList
Link copied to clipboard
class DataList : Iterable<DataItem> , DataItemConvertible, JsonPathExtractable<JsonPath.Component.Index>

The DataList represents a list of restricted data types which are wrappable by DataItem, to ensure that all data passed to the SDK can be used correctly and without unexpected behaviours when converting to Strings.

DataObject
Link copied to clipboard
class DataObject : Iterable<Map.Entry<String, DataItem>> , DataItemConvertible, DataItemExtractor

The DataObject represents a map of restricted data types which are wrappable by DataItem, to ensure that all data passed to the SDK can be used correctly and without unexpected behaviours when converting to Strings.

DataObjectConvertible
Link copied to clipboard
fun interface DataObjectConvertible : DataItemConvertible

Classes that implement this interface should be able to convert themselves successfully to an instance of DataObject.

Deserializer
Link copied to clipboard
fun interface Deserializer<T, R>

Transforms an input object of type T to an output object of type R

JsonListPath
Link copied to clipboard
typealias JsonListPath = JsonPath<JsonPath.Component.Index>

A JsonPath that can be applied to a JSON array to represent the path to a potentially nested value. Nested items can be in both JSON objects and JSON arrays.

JsonObjectPath
Link copied to clipboard
typealias JsonObjectPath = JsonPath<JsonPath.Component.Key>

A JsonPath that can be applied to a JSON object to represent the path to a potentially nested value. Nested items can be in both JSON objects and JSON arrays.

JsonPath
Link copied to clipboard
class JsonPath<TRoot : JsonPath.Component> : DataItemConvertible

A structure representing the location of an item in a JSON object or JSON array, potentially nested in other JSON objects and JSON arrays.

JsonPathExtractable
Link copied to clipboard
interface JsonPathExtractable<TRoot : JsonPath.Component>

Interface defining common methods for extracting DataItems using a JsonPath object.

JsonPathParseException
Link copied to clipboard
abstract class JsonPathParseException(message: String, cause: Throwable? = null) : TealiumException

Base exception for all Exceptions thrown when parsing a JsonPath.

JsonPathSyntaxException
Link copied to clipboard
class JsonPathSyntaxException(val position: Int, message: String, cause: Throwable? = null) : JsonPathParseException

Exception to indicate that there a syntax error in the provided JsonPath string which could not be parsed successfully.

LenientConverters
Link copied to clipboard
object LenientConverters

A collection of lenient converters that can handle type mismatches in JSON data.

ParcelableDataItem
Link copied to clipboard
class ParcelableDataItem(val dataItem: DataItem) : Parcelable

Parcelable wrapper class for DataItem to allow easy interop with Android Bundles

ReferenceContainer
Link copied to clipboard
class ReferenceContainer : DataObjectConvertible

A container for a reference to a variable in a DataObject

StringContainer
Link copied to clipboard
data class StringContainer(val value: String) : DataObjectConvertible

A container for holding a specific String.

UnexpectedEndOfInputException
Link copied to clipboard
class UnexpectedEndOfInputException(message: String, cause: Throwable? = null) : JsonPathParseException

Indicates that the parser reached the end of the JsonPath string input, but was expecting additional tokens.

UnsupportedDataItemException
Link copied to clipboard
class UnsupportedDataItemException(message: String? = null, cause: Throwable? = null) : TealiumException

This Exception is thrown in cases where a conversion from an value to a DataItem has been attempted but has failed to do so.

ValueContainer
Link copied to clipboard
data class ValueContainer(val value: DataItem) : DataObjectConvertible

A container for holding a specific DataItem.

Functions

asListPathOrNull
Link copied to clipboard
fun JsonPath<*>.asListPathOrNull(): JsonPath<JsonPath.Component.Index>?

Utility method to cast a JsonPath of unknown type, e.g. from a JsonPath.parse to the required type.

asObjectPathOrNull
Link copied to clipboard
fun JsonPath<*>.asObjectPathOrNull(): JsonPath<JsonPath.Component.Key>?

Utility method to cast a JsonPath of unknown type, e.g. from a JsonPath.parse to the required type.

asParcelable
Link copied to clipboard
fun DataItem.asParcelable(): ParcelableDataItem
fun DataList.asParcelable(): ParcelableDataItem
fun DataObject.asParcelable(): ParcelableDataItem

Returns a ParcelableDataItem that wraps the DataItem.

forEach
Link copied to clipboard
fun JSONArray.forEach(block: (value: Any) -> Unit)

Utility function to allow forEach iteration on a JSONArray

forEachIndexed
Link copied to clipboard
fun JSONArray.forEachIndexed(block: (value: Any, index: Int) -> Unit)

Utility function to allow forEach with index iteration on a JSONArray

get
Link copied to clipboard
operator fun <TRoot : JsonPath.Component> JsonPath<TRoot>.get(index: Int): JsonPath<TRoot>
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:

getDataItem
Link copied to clipboard
fun Bundle.getDataItem(key: String): DataItem?

Utility method to retrieve a DataItem from a Bundle. This method assumes that the object was originally placed into the Bundle as a ParcelableDataItem

getDataItemConvertible
Link copied to clipboard
fun <T> Bundle.getDataItemConvertible(key: String, converter: DataItemConverter<T>): T?

Utility method to retrieve a DataItemConvertible from a Bundle. This method assumes that the object was originally placed into the Bundle as a ParcelableDataItem

getDataList
Link copied to clipboard
fun Bundle.getDataList(key: String): DataList?

Utility method to retrieve a DataList from a Bundle. This method assumes that the object was originally placed into the Bundle as a ParcelableDataItem

getDataObject
Link copied to clipboard
fun Bundle.getDataObject(key: String): DataObject?

Utility method to retrieve a DataObject from a Bundle. This method assumes that the object was originally placed into the Bundle as a ParcelableDataItem

map
Link copied to clipboard
fun <T> JSONArray.map(transform: (value: Any) -> T): List<T>

Utility function to allow map iterating on a JSONArray

mapValues
Link copied to clipboard
inline fun <T> DataObject.mapValues(transform: (DataItem) -> T): Map<String, T>

Maps the Map.Entry.value component only, keeping the Map.Entry.key the same.

fun <T> JSONObject.mapValues(block: (value: Any) -> T): Map<String, T>

Utility function to allow transforming a JSONObject's values.

mapValuesNotNull
Link copied to clipboard
inline fun <T> DataObject.mapValuesNotNull(transform: (DataItem) -> T?): Map<String, T>

Maps the Map.Entry.value component only, keeping the Map.Entry.key the same.

plus
Link copied to clipboard
operator fun DataObject.plus(other: DataObject): DataObject

Merges two DataObject objects together.

putDataItem
Link copied to clipboard
fun Bundle.putDataItem(key: String, dataItem: DataItem)

Utility method to place a DataItem directly into a Bundle. This method will serialize as a ParcelableDataItem to store in the Bundle

putDataItemConvertible
Link copied to clipboard
fun Bundle.putDataItemConvertible(key: String, dataItemConvertible: DataItemConvertible)

Utility method to place a DataItemConvertible directly into a Bundle. This method will serialize as a ParcelableDataItem to store in the Bundle

putDataList
Link copied to clipboard
fun Bundle.putDataList(key: String, dataList: DataList)

Utility method to place a DataList directly into a Bundle. This method will serialize as a ParcelableDataItem to store in the Bundle

putDataObject
Link copied to clipboard
fun Bundle.putDataObject(key: String, dataObject: DataObject)

Utility method to place a DataObject directly into a Bundle. This method will serialize as a ParcelableDataItem to store in the Bundle

requireListPath
Link copied to clipboard
fun JsonPath<*>.requireListPath(): JsonPath<JsonPath.Component.Index>

Utility method to cast a JsonPath of unknown type, e.g. from a JsonPath.parse to the required type.

requireObjectPath
Link copied to clipboard
fun JsonPath<*>.requireObjectPath(): JsonPath<JsonPath.Component.Key>

Utility method to cast a JsonPath of unknown type, e.g. from a JsonPath.parse to the required type.

Generated by Dokka
(c) Tealium 2026