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

Mappings

interface Mappings

The Mappings interface is used to build up key/destination mappings used when optionally translating the full Dispatch payload to just the relevant data for any given Dispatcher

Use the multiple mapFrom methods to supply the required source "key" and "destination" key, as well as any optional "path" entries required to access keys in nested object.

Using the following payload DataObject as an example (shown as JSON)

{
"source" : "value",
"path": {
"to" : {
"source": "nested value"
}
}
}
Content copied to clipboard

Simple usage for keys in the top level DataObject would look like so:

mapFrom("source", "destination")
Content copied to clipboard

More complex versions requiring accessing keys that exist in nested objects would look like so:

mapFrom(JsonPath["path"]["to"]["source"], JsonPath["path"]["to"]["destination"])
Content copied to clipboard

The mapFrom method returns a VariableOptions that allows for setting optional properties relevant to a mapping.

See also

Mappings.VariableOptions
Mappings.ConstantOptions
Mappings.CommandOptions

Types

CommandOptions
Link copied to clipboard
interface CommandOptions : Mappings.ConstantOptions

The CommandOptions allows for configuring optional properties relevant only when mapping commands for Remote Command Dispatchers.

Companion
Link copied to clipboard
object Companion
ConstantOptions
Link copied to clipboard
interface ConstantOptions

The ConstantOptions allows for configuring optional properties relevant only when mapping constant values to the destination.

VariableOptions
Link copied to clipboard
interface VariableOptions

The VariableOptions allows for configuring optional properties relevant only when mapping values from the source payload.

Functions

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

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

keep
Link copied to clipboard
abstract fun keep(path: JsonObjectPath): Mappings.VariableOptions

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

abstract 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
abstract 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
abstract 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.

abstract 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
abstract 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.

abstract 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.

abstract 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.

abstract 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 fun path(root: String): JsonObjectPath

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

Generated by Dokka
(c) Tealium 2026