Target filter
Search Kotlin docs
  • Back
  • Tealium Prism Kotlin SDK Reference
core/com.tealium.prism.core.api.command/CommandMappingsBuilder

CommandMappingsBuilder

abstract class CommandMappingsBuilder<Command : CommandName, Destination : JsonObjectPathConvertible>(delegate: Mappings = Mappings.default()) : Mappings

Extends Mappings with type-safe command and destination overloads for CommandDispatcher-based dispatcher modules.

Subclasses supply concrete command type C and destination type D, giving callers enum-based safety for both. All base Mappings methods remain available via delegation.

Example:

class MyMappings : CommandMappingsBuilder<MyCommand, MyDestination>()
Content copied to clipboard

Constructors

CommandMappingsBuilder
Link copied to clipboard
constructor(delegate: Mappings = Mappings.default())

Functions

build
Link copied to clipboard
open override fun build(): List<MappingOperation>

Builds and returns the list of mapping TransformationOperations that have been configured.

keep
Link copied to clipboard
fun keep(destination: Destination): Mappings.VariableOptions

Keeps a typed destination path unchanged (source == destination).

open override fun keep(path: JsonObjectPath): Mappings.VariableOptions

Adds a mapping where the possibly nested path is both the source and destination of the mapping.

open override fun keep(key: String): Mappings.VariableOptions

Adds a mapping where the key is both the source and destination of the mapping.

mapCommand
Link copied to clipboard
fun mapCommand(command: Command): Mappings.CommandOptions

Maps a typed command to com.tealium.prism.core.api.tracking.Dispatch.Keys.COMMAND_NAME.

open override fun mapCommand(name: String): Mappings.CommandOptions

Adds a mapping where the value to map is given by the constant name and will be mapped to a fixed destination of Dispatch.Keys.COMMAND_NAME.

mapConstant
Link copied to clipboard
fun mapConstant(value: DataItem, destination: Destination): Mappings.ConstantOptions

Maps a constant value to a typed destination path.

open override fun mapConstant(value: DataItem, destination: JsonObjectPath): Mappings.ConstantOptions

Adds a mapping where the value to map is given by the constant value and will be mapped to the given destination located/stored at some configured level of nesting as defined by the JsonObjectPath.

open override fun mapConstant(value: DataItem, destination: String): Mappings.ConstantOptions

Adds a mapping where the value to map is given by the constant value and will be mapped to the given destination

mapFrom
Link copied to clipboard
fun mapFrom(path: JsonObjectPath, destination: Destination): Mappings.VariableOptions

Maps a nested path to a typed destination path.

fun mapFrom(key: String, destination: Destination): Mappings.VariableOptions

Maps a payload key to a typed destination path.

open override fun mapFrom(path: JsonObjectPath, destination: JsonObjectPath): Mappings.VariableOptions

Adds a mapping where both the path and destination can be located/stored at some configured level of nesting as defined by the JsonObjectPath for each input.

open override fun mapFrom(path: JsonObjectPath, destination: String): Mappings.VariableOptions

Adds a mapping where the destination is to be in the top level of the mapped payload, but the source key is defined at some nested object/list as defined by path.

open override fun mapFrom(key: String, destination: JsonObjectPath): Mappings.VariableOptions

Adds a mapping where the key is to be found in the top level of the input payload, but the destination key is to be defined at some nested object/list as defined by destination.

open override fun mapFrom(key: String, destination: String): Mappings.VariableOptions

Adds a mapping where the key and destination are in the top level of the payload.

path
Link copied to clipboard
open override fun path(root: String): JsonObjectPath

Utility method to start creating JsonObjectPaths. This method is shorthand for JsonPath.root

Generated by Dokka
(c) Tealium 2026