# A2uiDataPath

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

*** ** * ** ***


```
class A2uiDataPath
```

<br />

*** ** * ** ***

Parses JSON pointer strings (RFC 6901) into segments.

A JSON Pointer is a string syntax for identifying a specific value within a JSON document. This implementation aligns with the A2UI practices, which includes deviations from strict RFC 6901:

- Empty string `""` and `"/"` both evaluate to the root document (empty segments).

- A single trailing slash is stripped. (Note: To maintain parsing parity with other A2UI renderers, exactly one trailing slash is removed. e.g., "/foo//" evaluates to "/foo/").

- Missing leading slashes are permitted and represent relative paths.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#A2uiDataPath(kotlin.String)(path: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` |

| ### Public functions |
|---|---|
| `operator https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(androidx.a2ui.model.protocol.A2uiDataPath)(other: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath)` Appends another `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` to this path. |
| `operator https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(kotlin.String)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Appends a relative path segment `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(kotlin.String)` to this path. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#isAbsolute()` True if this path is absolute (starts with '/' or is empty representing root). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#normalizedPath()` The normalized, canonical JSON pointer string. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#path()` The raw JSON pointer string passed during construction. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#segments()` The decoded segments of the JSON pointer. |

## Public constructors

### A2uiDataPath

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

```
A2uiDataPath(path: String)
```

## Public functions

### div

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

```
operator fun div(other: A2uiDataPath): A2uiDataPath
```

Appends another `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` to this path.

If `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(androidx.a2ui.model.protocol.A2uiDataPath)` is absolute, it replaces this path.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath` | path to append |

### div

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

```
operator fun div(other: String): A2uiDataPath
```

Appends a relative path segment `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(kotlin.String)` to this path.

If `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiDataPath#div(kotlin.String)` starts with `/`, it is treated as an absolute path and replaces this path.

| Parameters |
|---|---|
| `other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | segment to append |

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### isAbsolute

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

```
val isAbsolute: Boolean
```

True if this path is absolute (starts with '/' or is empty representing root).

### normalizedPath

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

```
val normalizedPath: String
```

The normalized, canonical JSON pointer string.

### path

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

```
val path: String
```

The raw JSON pointer string passed during construction.

### segments

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

```
val segments: List<String>
```

The decoded segments of the JSON pointer.