# ParcelUtils

# ParcelUtils

Artifact:[androidx.versionedparcelable:versionedparcelable](https://developer.android.com/jetpack/androidx/releases/versionedparcelable)  
[View Source](https://cs.android.com/search?q=file:androidx/versionedparcelable/ParcelUtils.java+class:androidx.versionedparcelable.ParcelUtils)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/versionedparcelable#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/versionedparcelable/ParcelUtils "View this page in Java")

<br />

```
class ParcelUtils
```

<br />

*** ** * ** ***

Utilities for managing[VersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/VersionedParcelable)s.

## Summary

|                                                                                                 ### Public functions                                                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static T?`                                                                                                                                                                                                      | `<T : `[VersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/VersionedParcelable)`?> `[getVersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/ParcelUtils#getVersionedParcelable(android.os.Bundle,java.lang.String))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`, key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Get a VersionedParcelable from a Bundle.                                                                                                                                                                                                                                                                                                                |
| `java-static (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<T!>` | `<T : `[VersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/VersionedParcelable)`?> `[getVersionedParcelableList](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/ParcelUtils#getVersionedParcelableList(android.os.Bundle,java.lang.String))`(` ` bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`,` ` key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` `)` Get a list of VersionedParcelable from a Bundle.                                                                                                                                                                                                                                                                                     |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                           | [putVersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/ParcelUtils#putVersionedParcelable(android.os.Bundle,java.lang.String,androidx.versionedparcelable.VersionedParcelable))`(b: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`, key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, obj: `[VersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/VersionedParcelable)`?)` Add a VersionedParcelable to an existing Bundle.                                                                                                                                                                                                                                                              |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                           | [putVersionedParcelableList](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/ParcelUtils#putVersionedParcelableList(android.os.Bundle,java.lang.String,java.util.List<? extends androidx.versionedparcelable.VersionedParcelable>))`(` ` b: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`,` ` key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`,` ` list: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[VersionedParcelable](https://developer.android.com/reference/kotlin/androidx/versionedparcelable/VersionedParcelable)`!>` `)` Add a list of VersionedParcelable to an existing Bundle. |

## Public functions

### getVersionedParcelable

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

```
java-static fun <T : VersionedParcelable?> getVersionedParcelable(bundle: Bundle, key: String): T?
```

Get a VersionedParcelable from a Bundle. Returns null if the bundle isn't present or ClassLoader issues occur.  

### getVersionedParcelableList

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

```
java-static fun <T : VersionedParcelable?> getVersionedParcelableList(
    bundle: Bundle,
    key: String?
): (Mutable)List<T!>
```

Get a list of VersionedParcelable from a Bundle. Returns an empty list if the bundle isn't present or ClassLoader issues occur.  

### putVersionedParcelable

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

```
java-static fun putVersionedParcelable(b: Bundle, key: String, obj: VersionedParcelable?): Unit
```

Add a VersionedParcelable to an existing Bundle.  

### putVersionedParcelableList

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

```
java-static fun putVersionedParcelableList(
    b: Bundle,
    key: String,
    list: (Mutable)List<VersionedParcelable!>
): Unit
```

Add a list of VersionedParcelable to an existing Bundle.