Package com.google.android.exoplayer2.util

## Class BundleableUtils

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

-     public final class BundleableUtils
      extends Object

  Utilities for `Bundleable`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `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> T` | `fromNullableBundle​(Bundleable.Creator<T> creator, Bundle bundle)` | Converts a `Bundle` to a `Bundleable`.
    `static <T extends Bundleable> T` | `fromNullableBundle​(Bundleable.Creator<T> creator, Bundle bundle, T defaultValue)` | Converts a `Bundle` to a `Bundleable`.
    `static <T extends Bundleable> ArrayList<Bundle>` | `toBundleArrayList​(List<T> bundleableList)` | Converts a list 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 Bundle` | `toNullableBundle​(Bundleable bundleable)` | Converts a `Bundleable` to a `Bundle`.

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

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

- - ### Method Detail

    - #### toNullableBundle

          @Nullable
          public static Bundle toNullableBundle​(@Nullable
                                                Bundleable bundleable)

      Converts a `Bundleable` to a `Bundle`. It's a convenience wrapper of `Bundleable.toBundle()` that can take nullable values.

    - #### fromNullableBundle

          @Nullable
          public static <T extends Bundleable> T fromNullableBundle​(Bundleable.Creator<T> creator,
                                                                    @Nullable
                                                                    Bundle bundle)

      Converts a `Bundle` to a `Bundleable`. It's a convenience wrapper of `Bundleable.Creator.fromBundle(android.os.Bundle)` that can take nullable values.

    - #### fromNullableBundle

          public static <T extends Bundleable> T fromNullableBundle​(Bundleable.Creator<T> creator,
                                                                    @Nullable
                                                                    Bundle bundle,
                                                                    T defaultValue)

      Converts a `Bundle` to a `Bundleable`. It's a convenience wrapper of `Bundleable.Creator.fromBundle(android.os.Bundle)` that provides default value to ensure non-null.

    - #### 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​(List<T> bundleableList)

      Converts a list 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.