NavigatorProviderKt

Added in 1.0.0

public final class NavigatorProviderKt


Summary

Public methods

static final @NonNull T
<T extends Navigator<@NonNull NavDestination>> get(
    @NonNull NavigatorProvider receiver,
    @NonNull KClass<@NonNull T> clazz
)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

static final @NonNull T
<T extends Navigator<@NonNull NavDestination>> get(
    @NonNull NavigatorProvider receiver,
    @NonNull String name
)

Retrieves a registered Navigator by name.

static final void
plusAssign(
    @NonNull NavigatorProvider receiver,
    @NonNull Navigator<@NonNull NavDestination> navigator
)

Register a navigator using the name provided by the Navigator.Name annotation.

static final Navigator<@NonNull NavDestination>
set(
    @NonNull NavigatorProvider receiver,
    @NonNull String name,
    @NonNull Navigator<@NonNull NavDestination> navigator
)

Register a Navigator by name.

Public methods

public static final @NonNull T <T extends Navigator<@NonNull NavDestination>> get(
    @NonNull NavigatorProvider receiver,
    @NonNull KClass<@NonNull T> clazz
)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

Throws
kotlin.IllegalStateException

if the Navigator has not been added

public static final @NonNull T <T extends Navigator<@NonNull NavDestination>> get(
    @NonNull NavigatorProvider receiver,
    @NonNull String name
)

Retrieves a registered Navigator by name.

Throws
kotlin.IllegalStateException

if the Navigator has not been added

public static final void plusAssign(
    @NonNull NavigatorProvider receiver,
    @NonNull Navigator<@NonNull NavDestination> navigator
)

Register a navigator using the name provided by the Navigator.Name annotation.

public static final Navigator<@NonNull NavDestinationset(
    @NonNull NavigatorProvider receiver,
    @NonNull String name,
    @NonNull Navigator<@NonNull NavDestination> navigator
)

Register a Navigator by name. If a navigator by this name is already registered, this new navigator will replace it.

Returns
Navigator<@NonNull NavDestination>

the previously added Navigator for the given name, if any