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(Class<D> type)

Public methods

boolean
equals(Object other)
D
get(Bundle bundle, String key)

Get a value of this type from the bundle

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

Put a value of this type in the bundle

Inherited methods

From class NavType

Public fields

name

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(Class<D> type)
Parameters
Class<D> type

the Parcelable class that is supported by this NavType

Public methods

equals

public boolean equals(Object other)

get

public D get(Bundle bundle, String key)

Get a value of this type from the bundle

Parameters
Bundle bundle

bundle to get value from

String key

bundle key

Returns
D

value of this type

hashCode

public int hashCode()

parseValue

public @NonNullparseValue(String value)
Throws
kotlin.UnsupportedOperationException

since Parcelables do not support default values

put

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

Put a value of this type in the bundle

Parameters
Bundle bundle

bundle to put value in

String key

bundle key

D value

value of this type