# SubspaceSemanticsConfiguration

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration.kt+class:androidx.xr.compose.subspace.semantics.SubspaceSemanticsConfiguration) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
class SubspaceSemanticsConfiguration : SubspaceSemanticsPropertyReceiver, Iterable<Map.Entry<SemanticsPropertyKey<*>, Any?>>
```

<br />

*** ** * ** ***

Configuration of semantics properties for a spatial node.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#SubspaceSemanticsConfiguration()()` Creates a new, empty `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration`. |

| ### Public functions |
|---|---|
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#contains(androidx.compose.ui.semantics.SemanticsPropertyKey)(key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>)` Returns true if the configuration contains the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#contains(androidx.compose.ui.semantics.SemanticsPropertyKey)`. |
| `operator T` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#get(androidx.compose.ui.semantics.SemanticsPropertyKey)(key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>)` Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#get(androidx.compose.ui.semantics.SemanticsPropertyKey)` if present, or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` if not. |
| `T` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElse(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)(key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>, defaultValue: () -> T)` Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElse(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if present, or the result of `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElse(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if not. |
| `T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElseNullable(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)( key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>, defaultValue: () -> T? )` Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElseNullable(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if present, or the result of `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElseNullable(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if not. |
| `T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrNull(androidx.compose.ui.semantics.SemanticsPropertyKey)(key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>)` Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrNull(androidx.compose.ui.semantics.SemanticsPropertyKey)` if present, or null if not. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterator/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/-entry/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>>` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#iterator()()` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#set(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Any)(key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>, value: T)` Sets the semantics property defined by `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsPropertyReceiver#set(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsPropertyReceiver#set(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Any)`. |

### Inherited functions

From [kotlin.collections.Iterable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/for-each.html(
@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull action: https://developer.android.com/reference/java/util/function/Consumer.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/-entry/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>>
)` `open https://developer.android.com/reference/java/util/Spliterator.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/-entry/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>>` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/spliterator.html()`

## Public constructors

### SubspaceSemanticsConfiguration

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
SubspaceSemanticsConfiguration()
```

Creates a new, empty `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration`.

## Public functions

### contains

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

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

Returns true if the configuration contains the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#contains(androidx.compose.ui.semantics.SemanticsPropertyKey)`.

### get

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

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

Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#get(androidx.compose.ui.semantics.SemanticsPropertyKey)` if present, or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` if not.

### getOrElse

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

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

Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElse(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if present, or the result of `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElse(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if not.

### getOrElseNullable

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

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

Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElseNullable(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if present, or the result of `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrElseNullable(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Function0)` if not.

### getOrNull

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

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

Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsConfiguration#getOrNull(androidx.compose.ui.semantics.SemanticsPropertyKey)` if present, or null if not.

### iterator

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
open operator fun iterator(): Iterator<Map.Entry<SemanticsPropertyKey<*>, Any?>>
```

### set

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

Sets the semantics property defined by `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsPropertyReceiver#set(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/semantics/SubspaceSemanticsPropertyReceiver#set(androidx.compose.ui.semantics.SemanticsPropertyKey,kotlin.Any)`.

| Parameters |
|---|---|
| `key: https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsPropertyKey<T>` | The property key to set. |
| `value: T` | The value to assign to the property. |