NavType.SerializableType


public class NavType.SerializableType<D extends Serializable> extends NavType

Known direct subclasses
NavType.EnumType

EnumType is used for NavArguments holding enum values.


SerializableType is used for Serializable NavArguments. For handling Enums you must use EnumType instead.

Null values are supported. Default values in Navigation XML files are not supported.

See also
NavType.EnumType

Summary

Public constructors

Constructs a NavType that supports a given Serializable type.

Public methods

boolean
equals(Object other)
D
get(@NonNull Bundle bundle, @NonNull String key)
@NonNull String
int
@NonNull D
void
put(@NonNull Bundle bundle, @NonNull String key, @NonNull D value)

Inherited methods

From androidx.navigation.NavType
boolean
@NonNull D
parseValue(@NonNull String value, @NonNull D previousValue)
@NonNull String
@NonNull String
boolean
valueEquals(@NonNull D value, @NonNull D other)

Public constructors

SerializableType

public <D extends Serializable> SerializableType(@NonNull Class<@NonNull D> type)

Constructs a NavType that supports a given Serializable type.

Parameters
@NonNull Class<@NonNull D> type

class that is a subtype of Serializable

Public methods

equals

public boolean equals(Object other)

get

public D get(@NonNull Bundle bundle, @NonNull String key)

getName

public @NonNull String getName()

hashCode

public int hashCode()

parseValue

public @NonNullparseValue(@NonNull String value)
Throws
kotlin.UnsupportedOperationException

since Serializables do not support default values

put

Added in 1.0.0
public void put(@NonNull Bundle bundle, @NonNull String key, @NonNull D value)