# SemanticsConfiguration

# SemanticsConfiguration

Artifact:[androidx.glance:glance](https://developer.android.com/jetpack/androidx/releases/glance)  
[View Source](https://cs.android.com/search?q=file:androidx/glance/semantics/SemanticsProperties.kt+class:androidx.glance.semantics.SemanticsConfiguration)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

<br />

```
class SemanticsConfiguration : SemanticsPropertyReceiver
```

<br />

*** ** * ** ***

Describes the semantics information associated with the owning component.

## Summary

|                                                                ### Public constructors                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SemanticsConfiguration](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsConfiguration#SemanticsConfiguration())`()` |

|                                     ### Public functions                                      |
|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `operator T`                                                                                  | `<T : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?> `[get](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsConfiguration#get(androidx.glance.semantics.SemanticsPropertyKey))`(key: `[SemanticsPropertyKey](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsPropertyKey)`<T>)` Retrieves the value for the given property, if one has been set, If a value has not been set, throws[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html)          |
| `T?`                                                                                          | `<T : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?> `[getOrElseNullable](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsConfiguration#getOrElseNullable(androidx.glance.semantics.SemanticsPropertyKey,kotlin.Function0))`(` ` key: `[SemanticsPropertyKey](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsPropertyKey)`<T>,` ` defaultValue: () `->` T?` `)` Retrieves the value for the given property, if one has been set, If a value has not been set, returns the provided default value. |
| `T?`                                                                                          | `<T : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?> `[getOrNull](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsConfiguration#getOrNull(androidx.glance.semantics.SemanticsPropertyKey))`(key: `[SemanticsPropertyKey](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsPropertyKey)`<T>)` Retrieves the value for the given property, if one has been set, If a value has not been set, returns null                                                                                             |
| `open operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `<T : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?> `[set](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsConfiguration#set(androidx.glance.semantics.SemanticsPropertyKey,kotlin.Any))`(key: `[SemanticsPropertyKey](https://developer.android.com/reference/kotlin/androidx/glance/semantics/SemanticsPropertyKey)`<T>, value: T)`                                                                                                                                                                                               |

## Public constructors

### SemanticsConfiguration

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)  

```
SemanticsConfiguration()
```  

## Public functions

### get

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)  

```
operator fun <T : Any?> get(key: SemanticsPropertyKey<T>): T
```

Retrieves the value for the given property, if one has been set, If a value has not been set, throws[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html)  

### getOrElseNullable

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)  

```
fun <T : Any?> getOrElseNullable(
    key: SemanticsPropertyKey<T>,
    defaultValue: () -> T?
): T?
```

Retrieves the value for the given property, if one has been set, If a value has not been set, returns the provided default value.  

### getOrNull

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)  

```
fun <T : Any?> getOrNull(key: SemanticsPropertyKey<T>): T?
```

Retrieves the value for the given property, if one has been set, If a value has not been set, returns null  

### set

```
open operator fun <T : Any?> set(key: SemanticsPropertyKey<T>, value: T): Unit
```