NavType.ParcelableArrayType


class NavType.ParcelableArrayType<D : Parcelable> : NavType


ParcelableArrayType is used for NavArguments which hold arrays of Parcelables.

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

Summary

Public constructors

Public functions

open operator Boolean
equals(other: Any?)
open operator Array<D>?
get(bundle: SavedState, key: String)

Get a value of this type from the bundle

open Int
open Array<D>
open Unit
put(bundle: SavedState, key: String, value: Array<D>?)

Put a value of this type in the bundle

open Boolean
valueEquals(value: Array<D>?, other: Array<D>?)

Compares two values of type T and returns true if values are equal.

Public properties

open String

The name of this type.

Inherited functions

From androidx.navigation.NavType
open Array<D>?
parseValue(value: String, previousValue: Array<D>?)

Parse a value of this type from a String and then combine that parsed value with the given previousValue of the same type to provide a new value that contains both the new and previous value.

open String
serializeAsValue(value: Array<D>?)

Serialize a value of this NavType into a String.

open String

Inherited properties

From androidx.navigation.NavType
open Boolean

Check if an argument with this type can hold a null value.

Public constructors

ParcelableArrayType

<D : Parcelable> ParcelableArrayType(type: Class<D>)
Parameters
type: Class<D>

the type of Parcelable component class of the array

Public functions

equals

open operator fun equals(other: Any?): Boolean

get

open operator fun get(bundle: SavedState, key: String): Array<D>?

Get a value of this type from the bundle

Parameters
bundle: SavedState

SavedState to get value from

key: String

SavedState key

Returns
Array<D>?

value of this type

hashCode

open fun hashCode(): Int

parseValue

Added in 2.9.0-alpha04
open fun parseValue(value: String): Array<D>
Throws
kotlin.UnsupportedOperationException

since Arrays do not support default values

put

open fun put(bundle: SavedState, key: String, value: Array<D>?): Unit

Put a value of this type in the bundle

Parameters
bundle: SavedState

SavedState to put value in

key: String

SavedState key

value: Array<D>?

value of this type

valueEquals

Added in 2.8.0
open fun valueEquals(value: Array<D>?, other: Array<D>?): Boolean

Compares two values of type T and returns true if values are equal.

Parameters
value: Array<D>?

the first value for comparison

other: Array<D>?

the second value for comparison

Public properties

name

open val nameString

The name of this type.

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

Returns
String

name of this type