AttributesEditor

Wraps the Identity.Builder attribute map functions to provide an idiomatic Kotlin syntax.

For example

SFMCSdk.requestSdk { sdk ->
sdk.identity.edit {
attributes["key"] = "value" // assignment syntax
attributes += "key2" to "value2" // plus assignment syntax
}
}

Constructors

Link copied to clipboard
constructor(builder: Identity.Builder)

Functions

Link copied to clipboard
fun clear(vararg keys: String)
fun clear(keys: List<String>)

Clears the value of the specified attributes effectively setting them to null.

fun clear(key: String)

Clears the value of the specified attribute effectively setting it to null.

Link copied to clipboard
fun clearAll()

Clears the value of all attributes effectively setting them to null.

Link copied to clipboard
operator fun plusAssign(entry: Pair<String, String?>)

Updates or adds the value of an entry for the given key in the attribute map.

Link copied to clipboard
fun put(key: String, value: String?)

Updates or adds the value of an entry for the given key in the attribute map.

Link copied to clipboard
fun putAll(from: Map<out String, String?>)

Updates or adds all the values from the passed in map.

Link copied to clipboard
fun set(from: Map<out String, String?>)

First clears the values of all existing attributes values. Then updates or adds the values from the passed in map. Note: attribute keys cannot be removed, only the value can be cleared or set to null.

operator fun set(key: String, value: String?)

Updates or adds the value of an entry for the given key in the attribute map.