Stay organized with collections Save and categorize content based on your preferences.

ParcelUtils

public class ParcelUtils


Utilities for managing VersionedParcelables.

Summary

Public methods

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

Get a VersionedParcelable from a Bundle.

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

Get a list of VersionedParcelable from a Bundle.

static void

Add a VersionedParcelable to an existing Bundle.

static void

Add a list of VersionedParcelable to an existing Bundle.

Public methods

getVersionedParcelable

public static @Nullable T <T extends VersionedParcelable> getVersionedParcelable(
    @NonNull Bundle bundle,
    @NonNull String key
)

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

getVersionedParcelableList

public static @Nullable List<T> <T extends VersionedParcelable> 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.

putVersionedParcelable

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

Add a VersionedParcelable to an existing Bundle.

putVersionedParcelableList

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

Add a list of VersionedParcelable to an existing Bundle.