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

Builder

class Builder @JvmOverloads constructor(copy: DataList = EMPTY_LIST)

Constructors

Builder
Link copied to clipboard
@JvmOverloads
constructor(copy: DataList = EMPTY_LIST)

Functions

add
Link copied to clipboard
@JvmOverloads
fun add(value: DataItem, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a DataItem to the List.

@JvmOverloads
fun add(value: DataItemConvertible, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a DataItemConvertible to the list. The value is first converted into a DataItem using its implementation of asDataItem.

@JvmOverloads
fun add(value: Boolean, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a Boolean to the List.

@JvmOverloads
fun add(value: Double, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a Double to the List.

@JvmOverloads
fun add(value: Int, index: Int = DEFAULT_INDEX): DataList.Builder

Adds an Int to the List.

@JvmOverloads
fun add(value: Long, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a Long to the List.

@JvmOverloads
fun add(value: String, index: Int = DEFAULT_INDEX): DataList.Builder

Adds a String to the List.

addAll
Link copied to clipboard
@JvmOverloads
fun addAll(list: DataList, index: Int = DEFAULT_INDEX): DataList.Builder

Adds all entries from the given list to this builder. If an index is provided then the entries are inserted starting at that index.

addAny
Link copied to clipboard
@JvmOverloads
fun addAny(any: Any?, index: Int = DEFAULT_INDEX): DataList.Builder

Unsafe shortcut to put any object into the DataList.Builder. The any will attempt to be converted to a supported type. If an unsupported type is found, then this method with throw.

addAnyOrNull
Link copied to clipboard
@JvmOverloads
fun addAnyOrNull(any: Any?, index: Int = DEFAULT_INDEX): DataList.Builder

Unsafe shortcut to put any object into the DataObject. The any will attempt to be converted to a supported type. If no supported type is available, then DataItem.NULL will be returned.

addNull
Link copied to clipboard
@JvmOverloads
fun addNull(index: Int = DEFAULT_INDEX): DataList.Builder

Adds a DataItem.NULL to the list.

build
Link copied to clipboard
fun build(): DataList

Creates the new DataList based on the entries provided to this Builder

buildPath
Link copied to clipboard
fun buildPath(path: JsonListPath, item: DataItem): DataList.Builder

Takes a copy of this DataList and builds the necessary path according to the given path in order to store the given item.

clear
Link copied to clipboard
fun clear(): DataList.Builder

Removes all entries from the current Builder

get
Link copied to clipboard
operator fun get(index: Int): DataItem?

Gets the DataItem at the given index, if there is one.

remove
Link copied to clipboard
fun remove(index: Int): DataList.Builder

Removes the item at the give index.

size
Link copied to clipboard
fun size(): Int

Returns the number of entries currently in this DataList.Builder.

Generated by Dokka
(c) Tealium 2026