# NavDestinationBuilder

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavDestinationBuilder.+class:androidx.navigation.NavDestinationBuilder) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

*** ** * ** ***


```
@NavDestinationDsl
public class NavDestinationBuilder<D extends NavDestination>
```

<br />

Known direct subclasses [ActivityNavigatorDestinationBuilder](https://developer.android.com/reference/androidx/navigation/ActivityNavigatorDestinationBuilder), [DialogFragmentNavigatorDestinationBuilder](https://developer.android.com/reference/androidx/navigation/fragment/DialogFragmentNavigatorDestinationBuilder), [DynamicActivityNavigatorDestinationBuilder](https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicActivityNavigatorDestinationBuilder), [DynamicFragmentNavigatorDestinationBuilder](https://developer.android.com/reference/androidx/navigation/dynamicfeatures/fragment/DynamicFragmentNavigatorDestinationBuilder), [DynamicIncludeNavGraphBuilder](https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicIncludeNavGraphBuilder), [FragmentNavigatorDestinationBuilder](https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder), [NavGraphBuilder](https://developer.android.com/reference/androidx/navigation/NavGraphBuilder)

|---|---|
| `https://developer.android.com/reference/androidx/navigation/ActivityNavigatorDestinationBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/ActivityNavigator.Destination` |
| `https://developer.android.com/reference/androidx/navigation/fragment/DialogFragmentNavigatorDestinationBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/fragment/DialogFragmentNavigator.Destination` |
| `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicActivityNavigatorDestinationBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicActivityNavigator.Destination` |
| `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/fragment/DynamicFragmentNavigatorDestinationBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/fragment/DynamicFragmentNavigator.Destination` |
| `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicIncludeNavGraphBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicIncludeGraphNavigator.DynamicIncludeNavGraph` |
| `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/fragment/FragmentNavigator.Destination` |
| `https://developer.android.com/reference/androidx/navigation/NavGraphBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavGraph` |

Known indirect subclasses [DynamicNavGraphBuilder](https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicNavGraphBuilder)

|---|---|
| `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicNavGraphBuilder` | DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/dynamicfeatures/DynamicGraphNavigator.DynamicNavGraph` |

*** ** * ** ***

DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination`

## Summary

| ### Public constructors |
|---|
| `<D extends https://developer.android.com/reference/androidx/navigation/NavDestination> [NavDestinationBuilder](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#NavDestinationBuilder(androidx.navigation.Navigator,kotlin.Int))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator, @https://developer.android.com/reference/androidx/annotation/IdRes int id )` **This method is deprecated.** Use routes to build your NavDestination instead |
| `<D extends https://developer.android.com/reference/androidx/navigation/NavDestination> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#NavDestinationBuilder(androidx.navigation.Navigator,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator, https://developer.android.com/reference/java/lang/String.html route )` DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination` with a unique route. |
| `<D extends https://developer.android.com/reference/androidx/navigation/NavDestination> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#NavDestinationBuilder(androidx.navigation.Navigator,kotlin.reflect.KClass,kotlin.collections.Map)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap )` DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination` with a serializable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html`. |

| ### Public methods |
|---|---|
| `final void` | `[action](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#action(kotlin.Int,kotlin.Function1))( int actionId, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavActionBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> actionBuilder )` **This method is deprecated.** Building NavDestinations using IDs with the Kotlin DSL has been deprecated in favor of using routes. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#argument(kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavArgumentBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> argumentBuilder )` Add a `https://developer.android.com/reference/androidx/navigation/NavArgument` to this destination. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#argument(kotlin.String,androidx.navigation.NavArgument)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavArgument argument)` Add a `https://developer.android.com/reference/androidx/navigation/NavArgument` to this destination. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull D` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#build()()` Build the NavDestination by calling `https://developer.android.com/reference/androidx/navigation/Navigator#createDestination()`. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink )` Add a deep link to this destination. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(androidx.navigation.NavDeepLink)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLink navDeepLink)` Add a deep link to this destination. |
| `final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink )` Add a deep link to this destination. |
| `final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.reflect.KClass,kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink )` Add a deep link to this destination. |
| `final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLinkSafeArgs(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath)` Add a deep link to this destination. |
| `final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLinkSafeArgs(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html uriPattern)` Add a deep link to this destination. |
| `final int` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getId()()` The destination's unique ID. |
| `final https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getLabel()()` The descriptive label of the destination |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getRoute()()` The destination's unique route. |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#setLabel(kotlin.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence.html value)` The descriptive label of the destination |

| ### Protected methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D>` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getNavigator()()` The navigator the destination that will be used in `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#instantiateDestination()` to create the destination. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull D` | `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#instantiateDestination()()` Instantiate a new instance of `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder` that will be passed to `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#build()`. |

## Public constructors

### NavDestinationBuilder

```
public <D extends NavDestination> [NavDestinationBuilder](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#NavDestinationBuilder(androidx.navigation.Navigator,kotlin.Int))(
    @NonNull Navigator<@NonNull D> navigator,
    @IdRes int id
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use routes to build your NavDestination instead, use this instead:
>
> ```
> NavDestinationBuilder(navigator, route = id.toString())
> ```

DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination` with a unique id.

This sets the destination's `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#route()` to `null`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator` | navigator used to create the destination |
| `@https://developer.android.com/reference/androidx/annotation/IdRes int id` | the destination's unique id |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder<@https://developer.android.com/reference/androidx/annotation/NonNull D>` | the newly constructed `https://developer.android.com/reference/androidx/navigation/NavDestination` |

### NavDestinationBuilder

```
public <D extends NavDestination> NavDestinationBuilder(
    @NonNull Navigator<@NonNull D> navigator,
    String route
)
```

DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination` with a unique route.

This will also update the [id](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getId()) of the destination based on route.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator` | navigator used to create the destination |
| `https://developer.android.com/reference/java/lang/String.html route` | the destination's unique route |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder<@https://developer.android.com/reference/androidx/annotation/NonNull D>` | the newly constructed `https://developer.android.com/reference/androidx/navigation/NavDestination` |

### NavDestinationBuilder

```
public <D extends NavDestination> NavDestinationBuilder(
    @NonNull Navigator<@NonNull D> navigator,
    KClass<@NonNull ?> route,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap
)
```

DSL for constructing a new `https://developer.android.com/reference/androidx/navigation/NavDestination` with a serializable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html`.

This will also update the [id](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#getId()) of the destination based on KClass's serializer.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/Navigator<@https://developer.android.com/reference/androidx/annotation/NonNull D> navigator` | navigator used to create the destination |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route` | the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` of the destination |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | map of destination arguments' kotlin type `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html` to its respective custom `https://developer.android.com/reference/androidx/navigation/NavType`. May be empty if destination does not use custom NavTypes. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder<@https://developer.android.com/reference/androidx/annotation/NonNull D>` | the newly constructed `https://developer.android.com/reference/androidx/navigation/NavDestination` |

## Public methods

### action

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0) Deprecated in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void [action](https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#action(kotlin.Int,kotlin.Function1))(
    int actionId,
    @NonNull Function1<@NonNull NavActionBuilder, Unit> actionBuilder
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Building NavDestinations using IDs with the Kotlin DSL has been deprecated in favor of using routes. When using routes there is no need for actions.

Adds a new `https://developer.android.com/reference/androidx/navigation/NavAction` to the destination

### argument

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void argument(
    @NonNull String name,
    @NonNull Function1<@NonNull NavArgumentBuilder, Unit> argumentBuilder
)
```

Add a `https://developer.android.com/reference/androidx/navigation/NavArgument` to this destination.

### argument

Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
public final void argument(@NonNull String name, @NonNull NavArgument argument)
```

Add a `https://developer.android.com/reference/androidx/navigation/NavArgument` to this destination.

### build

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public @NonNull D build()
```

Build the NavDestination by calling `https://developer.android.com/reference/androidx/navigation/Navigator#createDestination()`.

### deepLink

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void deepLink(
    @NonNull Function1<@NonNull NavDeepLinkDslBuilder, Unit> navDeepLink
)
```

Add a deep link to this destination.

In addition to a direct Uri match, the following features are supported:

- Uris without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

- Placeholders in the form of `{placeholder_name}` matches 1 or more characters. The String value of the placeholder will be available in the arguments `https://developer.android.com/reference/androidx/savedstate/SavedState` with a key of the same name. For example, `http://www.example.com/users/{id}` will match `http://www.example.com/users/4`.

- The `.*` wildcard can be used to match 0 or more characters.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink` | the NavDeepLink to be added to this destination |

### deepLink

Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
public final void deepLink(@NonNull NavDeepLink navDeepLink)
```

Add a deep link to this destination.

In addition to a direct Uri match, the following features are supported:

- Uris without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

- Placeholders in the form of `{placeholder_name}` matches 1 or more characters. The String value of the placeholder will be available in the arguments `https://developer.android.com/reference/androidx/savedstate/SavedState` with a key of the same name. For example, `http://www.example.com/users/{id}` will match `http://www.example.com/users/4`.

- The `.*` wildcard can be used to match 0 or more characters.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLink navDeepLink` | the NavDeepLink to be added to this destination |

### deepLink

```
public final void <T extends Object> deepLink(
    @NonNull String basePath,
    @NonNull Function1<@NonNull NavDeepLinkDslBuilder, Unit> navDeepLink
)
```

Add a deep link to this destination.

The arguments in `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String,kotlin.Function1)` are expected to be identical (in name and type) to the arguments in the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#route()` from KClass that was used to construct this `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder`.

Extracts deeplink arguments from `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String,kotlin.Function1)` and appends it to the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String,kotlin.Function1)`. See docs on the safe args version of `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` for the final uriPattern's generation logic.

In addition to a direct Uri match, `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String,kotlin.Function1)`s without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | The deepLink KClass to extract arguments from |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath` | The base uri path to append arguments onto |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink` | the NavDeepLink to be added to this destination |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` | for the final uriPattern's generation logic. |

### deepLink

Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.9.0)

```
public final void <T extends Object> deepLink(
    @NonNull KClass<@NonNull T> route,
    @NonNull String basePath,
    @NonNull Function1<@NonNull NavDeepLinkDslBuilder, Unit> navDeepLink
)
```

Add a deep link to this destination.

The arguments in `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.reflect.KClass,kotlin.String,kotlin.Function1)` are expected to be identical (in name and type) to the arguments in the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#route()` that was used to construct this `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder`.

Extracts deeplink arguments from `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.reflect.KClass,kotlin.String,kotlin.Function1)` and appends it to the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.reflect.KClass,kotlin.String,kotlin.Function1)`. See docs on the safe args version of `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` for the final uriPattern's generation logic.

In addition to a direct Uri match, `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.reflect.KClass,kotlin.String,kotlin.Function1)`s without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route` | The deepLink KClass to extract arguments from |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath` | The base uri path to append arguments onto |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavDeepLinkDslBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> navDeepLink` | the NavDeepLink to be added to this destination |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` | for the final uriPattern's generation logic. |

### deepLinkSafeArgs

```
public final void <T extends Object> deepLinkSafeArgs(@NonNull String basePath)
```

Add a deep link to this destination.

The arguments in `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String)` are expected to be identical (in name and type) to the arguments in the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#route()` from KClass that was used to construct this `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder`.

Extracts deeplink arguments from `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String)` and appends it to the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String)`. See docs on the safe args version of `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` for the final uriPattern's generation logic.

In addition to a direct Uri match, `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String)`s without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | The deepLink KClass to extract arguments from |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html basePath` | The base uri path to append arguments onto |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDeepLink.Builder#setUriPattern(kotlin.String)` | for the final uriPattern's generation logic. |

### deepLinkSafeArgs

```
public final void <T extends Object> deepLinkSafeArgs(@NonNull String uriPattern)
```

Add a deep link to this destination.

In addition to a direct Uri match, the following features are supported:

- Uris without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

- Placeholders in the form of `{placeholder_name}` matches 1 or more characters. The String value of the placeholder will be available in the arguments `https://developer.android.com/reference/androidx/savedstate/SavedState` with a key of the same name. For example, `http://www.example.com/users/{id}` will match `http://www.example.com/users/4`.

- The `.*` wildcard can be used to match 0 or more characters.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html uriPattern` | The uri pattern to add as a deep link |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#deepLink(kotlin.String)` |   |

### getId

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final int getId()
```

The destination's unique ID.

### getLabel

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final CharSequence getLabel()
```

The descriptive label of the destination

### getRoute

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final String getRoute()
```

The destination's unique route.

### setLabel

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void setLabel(CharSequence value)
```

The descriptive label of the destination

## Protected methods

### getNavigator

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
protected final @NonNull Navigator<@NonNull D> getNavigator()
```

The navigator the destination that will be used in `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#instantiateDestination()` to create the destination.

### instantiateDestination

Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
protected @NonNull D instantiateDestination()
```

Instantiate a new instance of `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder` that will be passed to `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#build()`.

By default, this calls `https://developer.android.com/reference/androidx/navigation/Navigator#createDestination()` on `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#navigator()`, but can be overridden to call a custom constructor, etc.