public final class NavEntry<T extends Object>


Entry maintains and stores the key and the content represented by that key. Entries should be created as part of a reference/androidx/navigation/NavDisplay.

Parameters
<T extends Object>

the type of the key for this NavEntry

Summary

Public constructors

<T extends Object> NavEntry(
    @NonNull NavEntry<@NonNull T> navEntry,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)

NavEntry constructor to create a NavEntry from another NavEntry

<T extends Object> NavEntry(
    @NonNull T key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)

Public methods

final void

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

boolean
equals(Object other)
final @NonNull Object

A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any NavEntryDecorator states associated with this NavEntry.

final @NonNull Map<@NonNull String, @NonNull Object>

provides information to the display

int
@NonNull String

Public constructors

public <T extends Object> NavEntry(
    @NonNull NavEntry<@NonNull T> navEntry,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)

NavEntry constructor to create a NavEntry from another NavEntry

Parameters
@NonNull NavEntry<@NonNull T> navEntry

The entry that provides the key, contentKey, and metadata for the new entry.

@Composable @NonNull Function1<@NonNull T, Unit> content

content for this entry to be displayed when this entry is active

public <T extends Object> NavEntry(
    @NonNull T key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)
Parameters
<T extends Object>

the type of the key for this NavEntry

@NonNull T key

key for this entry

@NonNull Object contentKey

A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any NavEntryDecorator states associated with this NavEntry.

NavEntries that share the same contentKey will be handled as sharing the same content and/or
[NavEntryDecorator] state. To maximize stability, it should be derived from the [key]. The
contentKey type must be saveable (i.e. on Android, it should be saveable via Android).
Defaults to [key].toString().
@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull T, Unit> content

content for this entry to be displayed when this entry is active

Public methods

Content

Added in 1.0.0-alpha11
@Composable
public final void Content()

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

equals

public boolean equals(Object other)

getContentKey

Added in 1.0.0-alpha11
public final @NonNull Object getContentKey()

A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any NavEntryDecorator states associated with this NavEntry.

NavEntries that share the same contentKey will be handled as sharing the same content and/or
[NavEntryDecorator] state. To maximize stability, it should be derived from the [key]. The
contentKey type must be saveable (i.e. on Android, it should be saveable via Android).
Defaults to [key].toString().

getMetadata

Added in 1.0.0-alpha11
public final @NonNull Map<@NonNull String, @NonNull ObjectgetMetadata()

provides information to the display

hashCode

public int hashCode()

toString

public @NonNull String toString()