NavDestination.Companion


public static class NavDestination.Companion


Summary

Public methods

static final @NonNull Sequence<@NonNull NavDestination>

Provides a sequence of the NavDestination's hierarchy.

static final boolean
<T extends Object> hasRoute(@NonNull NavDestination receiver)

Checks if the NavDestination's route was generated from T

static final boolean
<T extends Object> hasRoute(
    @NonNull NavDestination receiver,
    @NonNull KClass<@NonNull T> route
)

Checks if the NavDestination's route was generated from T

Public methods

getHierarchy

Added in 2.4.0
public static final @NonNull Sequence<@NonNull NavDestinationgetHierarchy(@NonNull NavDestination receiver)

Provides a sequence of the NavDestination's hierarchy. The hierarchy starts with this destination itself and is then followed by this destination's NavDestination.parent, then that graph's parent, and up the hierarchy until you've reached the root navigation graph.

hasRoute

public static final boolean <T extends Object> hasRoute(@NonNull NavDestination receiver)

Checks if the NavDestination's route was generated from T

Returns true if equal, false otherwise.

Parameters
<T extends Object>

the route from KClass

hasRoute

Added in 2.8.0
public static final boolean <T extends Object> hasRoute(
    @NonNull NavDestination receiver,
    @NonNull KClass<@NonNull T> route
)

Checks if the NavDestination's route was generated from T

Returns true if equal, false otherwise.

Parameters
@NonNull KClass<@NonNull T> route

the route from KClass