Package com.google.android.exoplayer2.util

## Class BundleableUtil

- java.lang.Object
- - com.google.android.exoplayer2.util.BundleableUtil

-     public final class BundleableUtil
      extends Object

  Utilities for `Bundleable`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `ensureClassLoader​(Bundle bundle)` | Sets the application class loader to the given `Bundle` if no class loader is present.
    `static <T extends Bundleable> ImmutableList<T>` | `fromBundleList​(Bundleable.Creator<T> creator, List<Bundle> bundleList)` | Converts a list of `Bundle` to a list of `Bundleable`.
    `static <T extends Bundleable> SparseArray<T>` | `fromBundleSparseArray​(Bundleable.Creator<T> creator, SparseArray<Bundle> bundleSparseArray)` | Converts a `SparseArray` of `Bundle` to a `SparseArray` of `Bundleable`.
    `static <T extends Bundleable> ArrayList<Bundle>` | `toBundleArrayList​(Collection<T> bundleables)` | Converts a collection of `Bundleable` to an `ArrayList` of `Bundle` so that the returned list can be put to `Bundle` using `Bundle.putParcelableArrayList(java.lang.String, java.util.ArrayList<? extends android.os.Parcelable>)` conveniently.
    `static <T extends Bundleable> ImmutableList<Bundle>` | `toBundleList​(List<T> bundleableList)` | Converts a list of `Bundleable` to a list `Bundle`.
    `static <T extends Bundleable> SparseArray<Bundle>` | `toBundleSparseArray​(SparseArray<T> bundleableSparseArray)` | Converts a `SparseArray` of `Bundleable` to an `SparseArray` of `Bundle` so that the returned `SparseArray` can be put to `Bundle` using `Bundle.putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>)` conveniently.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### toBundleList

          public static <T extends Bundleable> ImmutableList<Bundle> toBundleList​(List<T> bundleableList)

      Converts a list of `Bundleable` to a list `Bundle`.

    - #### fromBundleList

          public static <T extends Bundleable> ImmutableList<T> fromBundleList​(Bundleable.Creator<T> creator,
                                                                               List<Bundle> bundleList)

      Converts a list of `Bundle` to a list of `Bundleable`.

    - #### toBundleArrayList

          public static <T extends Bundleable> ArrayList<Bundle> toBundleArrayList​(Collection<T> bundleables)

      Converts a collection of `Bundleable` to an `ArrayList` of `Bundle` so that the returned list can be put to `Bundle` using `Bundle.putParcelableArrayList(java.lang.String, java.util.ArrayList<? extends android.os.Parcelable>)` conveniently.

    - #### fromBundleSparseArray

          public static <T extends Bundleable> SparseArray<T> fromBundleSparseArray​(Bundleable.Creator<T> creator,
                                                                                    SparseArray<Bundle> bundleSparseArray)

      Converts a `SparseArray` of `Bundle` to a `SparseArray` of `Bundleable`.

    - #### toBundleSparseArray

          public static <T extends Bundleable> SparseArray<Bundle> toBundleSparseArray​(SparseArray<T> bundleableSparseArray)

      Converts a `SparseArray` of `Bundleable` to an `SparseArray` of `Bundle` so that the returned `SparseArray` can be put to `Bundle` using `Bundle.putSparseParcelableArray(java.lang.String, android.util.SparseArray<? extends android.os.Parcelable>)` conveniently.

    - #### ensureClassLoader

          public static void ensureClassLoader​(@Nullable
                                               Bundle bundle)

      Sets the application class loader to the given `Bundle` if no class loader is present.

      This assumes that all classes unparceled from `bundle` are sharing the class loader of `BundleableUtils`.