# CoreState

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

*** ** * ** ***


```
public final class CoreState
```

<br />

*** ** * ** ***

State of the XR system at a specific point in time.

Instances of this class can be accessed via the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html` property. This class may include extension properties provided by implementations of the `https://developer.android.com/reference/androidx/xr/runtime/StateExtender` interface found during `https://developer.android.com/reference/androidx/xr/runtime/Session` creation.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/xr/runtime/CoreState#CoreState(kotlin.time.ComparableTimeMark)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-comparable-time-mark/index.html timeMark)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/runtime/CoreState#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-comparable-time-mark/index.html` | `https://developer.android.com/reference/androidx/xr/runtime/CoreState#getTimeMark()()` at which the state was computed |
| `int` | `https://developer.android.com/reference/androidx/xr/runtime/CoreState#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/runtime/CoreState#toString()()` |

| ### Extension functions |
|---|---|
| `final https://developer.android.com/reference/androidx/xr/arcore/PerceptionState` | `https://developer.android.com/reference/androidx/xr/runtime/PerceptionStateExt.https://developer.android.com/reference/androidx/xr/runtime/CoreState#(androidx.xr.runtime.CoreState).getPerceptionState()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/CoreState receiver)` State of the perception system at a specific point in time, corresponding to a `https://developer.android.com/reference/androidx/xr/runtime/CoreState`. |

## Public constructors

### CoreState

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

```
public CoreState(@NonNull ComparableTimeMark timeMark)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getTimeMark

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

```
public final @NonNull ComparableTimeMark getTimeMark()
```

at which the state was computed

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```

## Extension functions

### PerceptionStateExt.getPerceptionState

Artifact: [androidx.xr.arcore:arcore](https://developer.android.com/jetpack/androidx/releases/xr-arcore) [View Source](https://cs.android.com/search?q=file:androidx/xr/arcore/PerceptionStateExtender.kt+symbol:perceptionState)

```
public final PerceptionState PerceptionStateExt.getPerceptionState(@NonNull CoreState receiver)
```

State of the perception system at a specific point in time, corresponding to a `https://developer.android.com/reference/androidx/xr/runtime/CoreState`.

This extension property provides a consistent snapshot of all available perception data (e.g., hands, eyes, trackables, depth, etc.) for the `https://developer.android.com/reference/androidx/xr/runtime/CoreState#timeMark()` of the receiver. All perception state objects within a single `https://developer.android.com/reference/androidx/xr/arcore/PerceptionState` instance are synchronized to that particular moment in time.