NavType.ParcelableType

public final class NavType.ParcelableType<D extends Object> extends NavType

Object
   ↳ NavType
     ↳ NavType.ParcelableType

ParcelableType is used for passing Parcelables in NavArguments.

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

Summary

Public fields

@NonNull String

The name of this type.

Public constructors

<D extends Object> ParcelableType(@NonNull Class<@NonNull D> type)

Public methods

boolean
@Nullable D
get(@NonNull Bundle bundle, @NonNull String key)

Get a value of this type from the bundle

int
@NonNull D
void
put(@NonNull Bundle bundle, @NonNull String key, @NonNull D value)

Put a value of this type in the bundle

Inherited methods

From class NavType

Public fields

name

@NonNull
public @NonNull String name

The name of this type.

This is the same value that is used in Navigation XML argType attribute.

Returns
@NonNull String

name of this type

Public constructors

ParcelableType

public final <D extends Object> ParcelableType(@NonNull Class<@NonNull D> type)
Parameters
@NonNull Class<@NonNull D> type

the Parcelable class that is supported by this NavType

Public methods

equals

@NonNull
public boolean equals(@Nullable Object other)

get

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

Get a value of this type from the bundle

Parameters
@NonNull Bundle bundle

bundle to get value from

@NonNull String key

bundle key

Returns
D

value of this type

hashCode

@NonNull
public int hashCode()

parseValue

@NonNull
public D parseValue(@NonNull String value)
Throws
kotlin.UnsupportedOperationException

since Parcelables do not support default values

put

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

Put a value of this type in the bundle

Parameters
@NonNull Bundle bundle

bundle to put value in

@NonNull String key

bundle key

@NonNull D value

value of this type