Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ParcelUtils

public class ParcelUtils
extends Object

java.lang.Object
   ↳ androidx.versionedparcelable.ParcelUtils


Utilities for managing VersionedParcelables.

Summary

Public methods

static <T extends VersionedParcelable> T getVersionedParcelable(Bundle bundle, String key)

Get a VersionedParcelable from a Bundle.

static <T extends VersionedParcelable> List<T> getVersionedParcelableList(Bundle bundle, String key)

Get a list of VersionedParcelable from a Bundle.

static void putVersionedParcelable(Bundle b, String key, VersionedParcelable obj)

Add a VersionedParcelable to an existing Bundle.

static void putVersionedParcelableList(Bundle b, String key, List<? extends VersionedParcelable> list)

Add a list of VersionedParcelable to an existing Bundle.

Inherited methods

Public methods

getVersionedParcelable

public static T getVersionedParcelable (Bundle bundle, 
                String key)

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

Parameters
bundle Bundle

key String

Returns
T

getVersionedParcelableList

public static List<T> getVersionedParcelableList (Bundle bundle, 
                String key)

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

Parameters
bundle Bundle

key String

Returns
List<T>

putVersionedParcelable

public static void putVersionedParcelable (Bundle b, 
                String key, 
                VersionedParcelable obj)

Add a VersionedParcelable to an existing Bundle.

Parameters
b Bundle

key String

obj VersionedParcelable

putVersionedParcelableList

public static void putVersionedParcelableList (Bundle b, 
                String key, 
                List<? extends VersionedParcelable> list)

Add a list of VersionedParcelable to an existing Bundle.

Parameters
b Bundle

key String

list List