# SelectionInfo.Builder

Artifact: [androidx.mediarouter:mediarouter](https://developer.android.com/jetpack/androidx/releases/mediarouter) [View Source](https://cs.android.com/search?q=file:androidx/mediarouter/media/SelectionInfo.java+class:androidx.mediarouter.media.SelectionInfo.Builder) Added in [1.9.0-rc01](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.9.0-rc01)

*** ** * ** ***


```
public final class SelectionInfo.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder#Builder()()` Creates an empty builder. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo` | `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo` instance. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder` | `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder#setSelectionSource(int)(int selectionSource)` Sets the source of the route selection. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder` | `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder#setUnselectReason(int)(int unselectReason)` Sets the unselect reason of the previously selected route. |

## Public constructors

### Builder

Added in [1.9.0-rc01](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.9.0-rc01)

```
public Builder()
```

Creates an empty builder.

## Public methods

### build

Added in [1.9.0-rc01](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.9.0-rc01)

```
public @NonNull SelectionInfo build()
```

Builds the `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo` instance.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo` | The built `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo` instance. |

### setSelectionSource

Added in [1.9.0-rc01](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.9.0-rc01)

```
public @NonNull SelectionInfo.Builder setSelectionSource(int selectionSource)
```

Sets the source of the route selection.

The default value is `https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo#SELECTION_SOURCE_UNKNOWN()`.

| Parameters |
|---|---|
| `int selectionSource` | The selection source. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder` | The builder instance. |

### setUnselectReason

Added in [1.9.0-rc01](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.9.0-rc01)

```
public @NonNull SelectionInfo.Builder setUnselectReason(int unselectReason)
```

Sets the unselect reason of the previously selected route.

The default value is `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter#UNSELECT_REASON_UNKNOWN()`.

| Parameters |
|---|---|
| `int unselectReason` | The unselect reason. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/SelectionInfo.Builder` | The builder instance. |