# NavType.SerializableArrayType

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavType.android.kt+class:androidx.navigation.NavType.SerializableArrayType) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVMJavaScript
- android

  ```
  class NavType.SerializableArrayType<D : Serializable> : NavType<Array<D>?>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.navigation.NavType](https://developer.android.com/reference/kotlin/androidx/navigation/NavType)\<[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)\<D\>?\> ||
|   | ↳ | [androidx.navigation.NavType.SerializableArrayType](https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType) |

*** ** * ** ***

SerializableArrayType is used for `https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument`s that hold arrays of Serializables. This type also supports arrays of Enums.

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

## Summary

| ### Public constructors |
|---|---|
| `<D : https://developer.android.com/reference/java/io/Serializable.html> https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#SerializableArrayType(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<D>)` | android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#get(android.os.Bundle,kotlin.String)(bundle: https://developer.android.com/reference/android/os/Bundle.html, key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Get a value of this type from the `savedState` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#hashCode()()` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#parseValue(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#put(android.os.Bundle,kotlin.String,kotlin.Array)(bundle: https://developer.android.com/reference/android/os/Bundle.html, key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?)` Put a value of this type in the `savedState` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#valueEquals(kotlin.Array,kotlin.Array)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?, other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?)` Compares two values of type `https://developer.android.com/reference/kotlin/androidx/navigation/NavType` and returns true if values are equal. | android |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavType.SerializableArrayType#name()` The name of this type. | android |

### Inherited functions

From [androidx.navigation.NavType](https://developer.android.com/reference/kotlin/androidx/navigation/NavType) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` `https://developer.android.com/reference/kotlin/androidx/navigation/NavType#parseValue(kotlin.String,kotlin.Any)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, previousValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<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.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/navigation/NavType#serializeAsValue(kotlin.Any)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?)`

Serialize a value of this NavType into a String.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/navigation/NavType#toString()()` android

### Inherited properties

From [androidx.navigation.NavType](https://developer.android.com/reference/kotlin/androidx/navigation/NavType) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/navigation/NavType#isNullableAllowed()`

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

## Public constructors

### SerializableArrayType

android

```
<D : Serializable> SerializableArrayType(type: Class<D>)
```

| Parameters |
|---|---|
| `type: https://developer.android.com/reference/java/lang/Class.html<D>` | the Serializable component class of the array |

## Public functions

### equals

android

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

### get

android

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

Get a value of this type from the `savedState`

| Parameters |
|---|---|
| `bundle: https://developer.android.com/reference/android/os/Bundle.html` | savedState to get value from |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | savedState key |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` | value of this type |

### hashCode

android

```
open fun hashCode(): Int
```

### parseValue

android

```
open fun parseValue(value: String): Array<D>
```

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | since Arrays do not support default values |

### put

android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation#1.0.0)

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

Put a value of this type in the `savedState`

| Parameters |
|---|---|
| `bundle: https://developer.android.com/reference/android/os/Bundle.html` | savedState to put value in |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | savedState key |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` | value of this type |

### valueEquals

android Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

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

Compares two values of type `https://developer.android.com/reference/kotlin/androidx/navigation/NavType` and returns true if values are equal.

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` | the first value for comparison |
| `other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<D>?` | the second value for comparison |

## Public properties

### name

android

```
open val name: String
```

The name of this type.

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | name of this type |