Class BundleableUtils
- java.lang.Object
-
- com.google.android.exoplayer2.util.BundleableUtils
-
public final class BundleableUtils extends Object
Utilities forBundleable.
-
-
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 ofBundleto a list ofBundleable.static <T extends Bundleable>
TfromNullableBundle(Bundleable.Creator<T> creator, Bundle bundle)Converts aBundleto aBundleable.static <T extends Bundleable>
TfromNullableBundle(Bundleable.Creator<T> creator, Bundle bundle, T defaultValue)Converts aBundleto aBundleable.static <T extends Bundleable>
ArrayList<Bundle>toBundleArrayList(List<T> bundleableList)Converts a list ofBundleableto anArrayListofBundleso that the returned list can be put toBundleusingBundle.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 ofBundleableto a listBundle.static BundletoNullableBundle(Bundleable bundleable)Converts aBundleableto aBundle.
-
-
-
Method Detail
-
toNullableBundle
@Nullable public static Bundle toNullableBundle(@Nullable Bundleable bundleable)
Converts aBundleableto aBundle. It's a convenience wrapper ofBundleable.toBundle()that can take nullable values.
-
fromNullableBundle
@Nullable public static <T extends Bundleable> T fromNullableBundle(Bundleable.Creator<T> creator, @Nullable Bundle bundle)
Converts aBundleto aBundleable. It's a convenience wrapper ofBundleable.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 aBundleto aBundleable. It's a convenience wrapper ofBundleable.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 ofBundleableto a listBundle.
-
fromBundleList
public static <T extends Bundleable> ImmutableList<T> fromBundleList(Bundleable.Creator<T> creator, List<Bundle> bundleList)
Converts a list ofBundleto a list ofBundleable.
-
toBundleArrayList
public static <T extends Bundleable> ArrayList<Bundle> toBundleArrayList(List<T> bundleableList)
Converts a list ofBundleableto anArrayListofBundleso that the returned list can be put toBundleusingBundle.putParcelableArrayList(java.lang.String, java.util.ArrayList<? extends android.os.Parcelable>)conveniently.
-
-