Known direct subclasses
StaticKeyDeepLinkMatcher

A DeepLinkMatcher that matches based on a list of Filter and if all filters match, returns the input key in the MatchResult.

UriDeepLinkMatcher

Represents a deep link that can be deep linked into when matched with a DeepLinkRequest


Encompasses the logic to match a navigation key of type T against a DeepLinkRequest.

A navigation key can be associated with more than one DeepLinkMatcher if it supports different forms of deep links.

T The type of the navigation key associated with this deep link.

Summary

Nested types

A filter for a deep link, such as a mimeType.

The class that is returned when a DeepLinkMatcher matches with a DeepLinkRequest

Public companion functions

DeepLinkMatcher.Filter

Creates a DeepLinkMatcher.Filter that filters a DeepLinkRequest with the mimeType defined on the DeepLinkMatcher.

Cmn

Public constructors

Cmn

Public functions

DeepLinkMatcher.MatchResult<T>?

Matches a DeepLinkRequest to a DeepLinkMatcher.

Cmn

Protected functions

abstract DeepLinkMatcher.MatchResult<T>?

Matches a DeepLinkRequest to a DeepLinkMatcher.

Cmn

Public companion functions

mimeTypeFilter

fun mimeTypeFilter(mimeType: String): DeepLinkMatcher.Filter

Creates a DeepLinkMatcher.Filter that filters a DeepLinkRequest with the mimeType defined on the DeepLinkMatcher. Matching is not case-sensitive.

Parameters
mimeType: String

the action the filter by

Returns
DeepLinkMatcher.Filter

true if the mimeType exactly matches the DeepLinkMatcher's action or if the matcher did not define any actions, false otherwise.

Public constructors

DeepLinkMatcher

<T : Any> DeepLinkMatcher(filters: List<DeepLinkMatcher.Filter> = emptyList())
Parameters
filters: List<DeepLinkMatcher.Filter> = emptyList()

an optional list of Filter to apply to the DeepLinkRequest during matching

Public functions

match

fun match(request: DeepLinkRequest): DeepLinkMatcher.MatchResult<T>?

Matches a DeepLinkRequest to a DeepLinkMatcher.

The entry point to match a DeepLinkMatcher to a DeepLinkRequest. It iterates through any filters and if all filters returns true, proceeds to call matchRequest to get the final match result.

Returns MatchResult if it is a match, and returns null otherwise.

Parameters
request: DeepLinkRequest

the DeepLinkRequest to match against

Protected functions

matchRequest

protected abstract fun matchRequest(request: DeepLinkRequest): DeepLinkMatcher.MatchResult<T>?

Matches a DeepLinkRequest to a DeepLinkMatcher.

The core function that is called within the matching process after all filters are applied. Subclasses should override this to implement matching logic beyond matching filters.

Returns MatchResult if it is a match, and returns null otherwise.

Parameters
request: DeepLinkRequest

the DeepLinkRequest to match against