# 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)

*** ** * ** ***


```
public final class NavType.SerializableArrayType<D extends Serializable> extends NavType<D[]>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.navigation.NavType](https://developer.android.com/reference/androidx/navigation/NavType)\<D\[\]\> ||
|   | ↳ | [androidx.navigation.NavType.SerializableArrayType](https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType) |

*** ** * ** ***

SerializableArrayType is used for `https://developer.android.com/reference/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 extends https://developer.android.com/reference/java/io/Serializable.html> https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#SerializableArrayType(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull D> type)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `D[]` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#get(android.os.Bundle,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key)` Get a value of this type from the `savedState` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#getName()()` The name of this type. |
| `int` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull D[]` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#parseValue(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html value)` |
| `void` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#put(android.os.Bundle,kotlin.String,kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key, D[] value)` Put a value of this type in the `savedState` |
| `boolean` | `https://developer.android.com/reference/androidx/navigation/NavType.SerializableArrayType#valueEquals(kotlin.Array,kotlin.Array)(D[] value, D[] other)` Compares two values of type `https://developer.android.com/reference/androidx/navigation/NavType` and returns true if values are equal. |

### Inherited methods

From [androidx.navigation.NavType](https://developer.android.com/reference/androidx/navigation/NavType) `boolean` `https://developer.android.com/reference/androidx/navigation/NavType#isNullableAllowed()()`

Check if an argument with this type can hold a null value.
`D[]` `https://developer.android.com/reference/androidx/navigation/NavType#parseValue(kotlin.String,kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html value, D[] previousValue)`

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.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/navigation/NavType#serializeAsValue(kotlin.Any)(D[] value)`

Serialize a value of this NavType into a String.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/navigation/NavType#toString()()`

## Public constructors

### SerializableArrayType

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

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### get

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

Get a value of this type from the `savedState`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle` | savedState to get value from |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key` | savedState key |

| Returns |
|---|---|
| `D[]` | value of this type |

### getName

```
public @NonNull String getName()
```

The name of this type.

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

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | name of this type |

### hashCode

```
public int hashCode()
```

### parseValue

```
public @NonNull D[] parseValue(@NonNull String value)
```

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

### put

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

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

Put a value of this type in the `savedState`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle` | savedState to put value in |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key` | savedState key |
| `D[] value` | value of this type |

### valueEquals

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

```
public boolean valueEquals(D[] value, D[] other)
```

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

| Parameters |
|---|---|
| `D[] value` | the first value for comparison |
| `D[] other` | the second value for comparison |