> Documentation index: https://developer.android.com/reference/llms.txt

# AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java+class:androidx.core.view.accessibility.AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder) Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

*** ** * ** ***


```
@PreviewAccessibilityApi
public final class AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder
```

<br />

*** ** * ** ***

Builder for creating `SelectionPositionCompat` objects.

## Summary

| ### Public constructors |
|---|
| `Builder(@NonNull AccessibilityNodeInfoCompat node, int offset)` Creates a new Builder. |
| `Builder(@NonNull View view, int offset)` Creates a new Builder. |
| `Builder(@NonNull View view, int virtualDescendantId, int offset)` Creates a new Builder. |

| ### Public methods |
|---|---|
| `@NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat` | `build()` Creates a new `SelectionPositionCompat` instance. |
| `@NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder` | `setOffsetType(int offsetType)` Sets the offset type for the position. |

## Public constructors

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
public Builder(@NonNull AccessibilityNodeInfoCompat node, int offset)
```

Creates a new Builder.

| Parameters |
|---|---|
| `@NonNull AccessibilityNodeInfoCompat node` | The `AccessibilityNodeInfoCompat` for the node of this position. |
| `int offset` | The offset for the position. |

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
public Builder(@NonNull View view, int offset)
```

Creates a new Builder.

| Parameters |
|---|---|
| `@NonNull View view` | The `View` containing the text associated with this selection. |
| `int offset` | The offset for the position. |

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
public Builder(@NonNull View view, int virtualDescendantId, int offset)
```

Creates a new Builder.

| Parameters |
|---|---|
| `@NonNull View view` | The view whose virtual descendant is associated with the selection position. |
| `int virtualDescendantId` | The virtual descendant id. |
| `int offset` | The offset for the position. |

## Public methods

### build

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
public @NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat build()
```

Creates a new `SelectionPositionCompat` instance.

### setOffsetType

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
public @NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder setOffsetType(int offsetType)
```

Sets the offset type for the position.

| Parameters |
|---|---|
| `int offsetType` | The scheme dictating how the offset should be interpreted. |

| Returns |
|---|---|
| `@NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder` | This builder. |

| Throws |
|---|---|
| `java.lang.IllegalArgumentException` | If the `offsetType` is unknown. |