SemanticsPropertyKey

class SemanticsPropertyKey<T : Any?>


SemanticsPropertyKey is the infrastructure for setting key/value pairs inside semantics block in a type-safe way. Each key has one particular statically defined value type T.

Summary

Public constructors

<T : Any?> SemanticsPropertyKey(name: String, mergePolicy: (T, T?) -> T?)

Public functions

T?
merge(parentValue: T?, childValue: T)

Public properties

String

The name of the property.

Public constructors

SemanticsPropertyKey

<T : Any?> SemanticsPropertyKey(
    name: String,
    mergePolicy: (T, T?) -> T? = { parentValue, childValue -> parentValue ?: childValue }
)

Public functions

merge

Added in 1.0.0
fun merge(parentValue: T?, childValue: T): T?

Public properties

name

Added in 1.0.0
val nameString

The name of the property. Should be the same as the constant from shich it is accessed.