---
title: "SemanticsPropertyKey"
description: "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."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
public class SemanticsPropertyKey<T>(
    /** The name of the property. Should be the same as the constant from shich it is accessed. */
    public val name: String,
    internal val mergePolicy: (T?, T) -> T? = { parentValue, childValue ->
        parentValue ?: childValue
    },
)
```


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.


## Functions

```kotlin
public fun merge(parentValue: T?, childValue: T): T?
```


