# A2uiCoreDataModel

Artifact: [androidx.a2ui:a2ui-engine](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/engine/platform/A2uiCoreDataModel.kt+class:androidx.a2ui.engine.platform.A2uiCoreDataModel) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
interface A2uiCoreDataModel : AutoCloseable
```

<br />

*** ** * ** ***

A storage interface for the JSON data tree.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreDataModel#close()()` Cleans up resources (e.g., clearing registries to prevent memory leaks). |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreDataModel#get(androidx.a2ui.model.protocol.A2uiDataPath)(path: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath)` Retrieves the value at the given absolute path. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/engine/platform/A2uiCoreDataModel#update(androidx.a2ui.model.protocol.A2uiDataPath,kotlin.Any)(path: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Replaces the value at the given absolute path. |

## Public functions

### close

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

```
fun close(): Unit
```

Cleans up resources (e.g., clearing registries to prevent memory leaks).

### get

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

```
operator fun get(path: A2uiDataPath): Any?
```

Retrieves the value at the given absolute path.

| Parameters |
|---|---|
| `path: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` | The absolute JSON pointer path to the data point to retrieve. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | The value stored at the given path, or `null` if the path does not exist or has no value. The returned type will correspond to a standard JSON data type: `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`, `null`, `Map<String, Any?>` (for JSON objects), or `List<Any?>` (for JSON arrays). |

### update

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

```
fun update(path: A2uiDataPath, value: Any?): Unit
```

Replaces the value at the given absolute path.

| Parameters |
|---|---|
| `path: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` | The absolute JSON pointer path to the data point to update. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | The new value to store at the given path. The type must correspond to a standard JSON data type: `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html`, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html`, `null`, `Map<String, Any?>` (for JSON objects), or `List<Any?>` (for JSON arrays). |