# StaticKeyDeepLinkMatcher

Artifact: [androidx.navigation3:navigation3-runtime](https://developer.android.com/jetpack/androidx/releases/navigation3) [View Source](https://cs.android.com/search?q=file:androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher.kt+class:androidx.navigation3.runtime.deeplink.StaticKeyDeepLinkMatcher) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.2.0) Common/AllAndroid/JVM
- Cmn

  ```
  class StaticKeyDeepLinkMatcher<T : Any> : DeepLinkMatcher<T, DeepLinkMatcher.MatchResult<T>>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.navigation3.runtime.deeplink.DeepLinkMatcher](https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher)\<T, [DeepLinkMatcher.MatchResult](https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult)\<T\>\> ||
|   | ↳ | [androidx.navigation3.runtime.deeplink.StaticKeyDeepLinkMatcher](https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher) |

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher` that matches based on a list of `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.Filter` and if all filters match, returns the input `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#(kotlin.Any,kotlin.collections.List)` in the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult`.

`https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher` The Type of the navigation key associated with this deep link matcher.

```kotlin
import androidx.navigation3.runtime.deeplink.DeepLinkMatcher
import androidx.navigation3.runtime.deeplink.DeepLinkRequest
import androidx.navigation3.runtime.deeplink.DeepLinkUri
import androidx.navigation3.runtime.deeplink.StaticKeyDeepLinkMatcher

// declare a matcher based on mime type
val mimeType = "image/jpg"
val mimeTypeFilter = DeepLinkMatcher.mimeTypeFilter(mimeType)
val matcher = StaticKeyDeepLinkMatcher(ImageKey, listOf(mimeTypeFilter))

// when handling a request
val request =
    DeepLinkRequest(
        uri = DeepLinkUri("$SAMPLE_BASE_PATH/images/"),
        extras = DeepLinkRequest.mimeTypeExtra(mimeType),
    )
// returns a valid result as long as mimeType matches
val matchResult: DeepLinkMatcher.MatchResult<ImageKey>? = matcher.match(request)
```

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#StaticKeyDeepLinkMatcher(kotlin.Any,kotlin.collections.List)( key: T, filters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.Filter> )` | Cmn |

| ### Protected functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult<T>` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#matchRequest(androidx.navigation3.runtime.deeplink.DeepLinkRequest)(request: https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest)` Returns a `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult` containing the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#key()` if all `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher#filters()` match the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest`. | Cmn |

| ### Public properties |
|---|---|---|
| `T` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#key()` the navigation key associated with this deep link matcher | Cmn |

### Inherited functions

From [androidx.navigation3.runtime.deeplink.DeepLinkMatcher](https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher) `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult<T>?` `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher#match(androidx.navigation3.runtime.deeplink.DeepLinkRequest)(request: https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest)`

Matches a `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest` to a `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher`.
Cmn

## Public constructors

### StaticKeyDeepLinkMatcher

Cmn

```
<T : Any> StaticKeyDeepLinkMatcher(
    key: T,
    filters: List<DeepLinkMatcher.Filter>
)
```

| Parameters |
|---|---|
| `key: T` | the navigation key associated with this deep link matcher |
| `filters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.Filter>` | the list of `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.Filter` to match with the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest` |

## Protected functions

### matchRequest

Cmn

```
protected open fun matchRequest(request: DeepLinkRequest): DeepLinkMatcher.MatchResult<T>
```

Returns a `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher.MatchResult` containing the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/StaticKeyDeepLinkMatcher#key()` if all `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkMatcher#filters()` match the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/deeplink/DeepLinkRequest`.

## Public properties

### key

Cmn Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.2.0)

```
val key: T
```

the navigation key associated with this deep link matcher