BundleCollectionUtil
@UnstableApi
class BundleCollectionUtil
Utilities for converting collections to and from Bundle instances.
Summary
Public functions |
|
|---|---|
java-static HashMap<String!, String!>! |
bundleToStringHashMap(bundle: Bundle!) |
java-static ImmutableMap<String!, String!>! |
bundleToStringImmutableMap(bundle: Bundle!) |
java-static Unit |
ensureClassLoader(bundle: Bundle?)Sets the application class loader to the given |
java-static ImmutableList<T!>! |
<T : Any?> fromBundleList(Unbundles a list of |
java-static SparseArray<T!>! |
<T : Any?> fromBundleSparseArray(Unbundles a |
java-static Bundle! |
getBundleWithDefault(bundle: Bundle!, field: String!, defaultValue: Bundle!) |
java-static ArrayList<Int!>! |
getIntegerArrayListWithDefault( |
java-static Bundle! |
stringMapToBundle(map: (Mutable)Map<String!, String!>!) |
java-static ArrayList<Bundle!>! |
<T : Any?> toBundleArrayList(Bundles a collection of objects to an |
java-static ImmutableList<Bundle!>! |
Bundles a list of objects to a list of |
java-static SparseArray<Bundle!>! |
<T : Any?> toBundleSparseArray(Bundles a |
Public functions
bundleToStringHashMap
java-static fun bundleToStringHashMap(bundle: Bundle!): HashMap<String!, String!>!
bundleToStringImmutableMap
java-static fun bundleToStringImmutableMap(bundle: Bundle!): ImmutableMap<String!, String!>!
ensureClassLoader
java-static fun ensureClassLoader(bundle: Bundle?): Unit
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 BundleCollectionUtil.
fromBundleList
java-static fun <T : Any?> fromBundleList(
fromBundleFunc: Function<Bundle!, T!>!,
bundleList: (Mutable)List<Bundle!>!
): ImmutableList<T!>!
Unbundles a list of Bundle instances to a list of objects.
| Parameters | |
|---|---|
fromBundleFunc: Function<Bundle!, T!>! |
Function that specified how to unbundle each item. |
bundleList: (Mutable)List<Bundle!>! |
List of |
| Returns | |
|---|---|
ImmutableList<T!>! |
The |
fromBundleSparseArray
java-static fun <T : Any?> fromBundleSparseArray(
fromBundleFunc: Function<Bundle!, T!>!,
bundleSparseArray: SparseArray<Bundle!>!
): SparseArray<T!>!
Unbundles a SparseArray of Bundle instances to a SparseArray of objects.
| Parameters | |
|---|---|
fromBundleFunc: Function<Bundle!, T!>! |
Function that specified how to unbundle each item. |
bundleSparseArray: SparseArray<Bundle!>! |
|
| Returns | |
|---|---|
SparseArray<T!>! |
The |
getBundleWithDefault
java-static fun getBundleWithDefault(bundle: Bundle!, field: String!, defaultValue: Bundle!): Bundle!
getIntegerArrayListWithDefault
java-static fun getIntegerArrayListWithDefault(
bundle: Bundle!,
field: String!,
defaultValue: ArrayList<Int!>!
): ArrayList<Int!>!
toBundleArrayList
java-static fun <T : Any?> toBundleArrayList(
items: (Mutable)Collection<T!>!,
toBundleFunc: Function<T!, Bundle!>!
): ArrayList<Bundle!>!
Bundles a collection of objects to an ArrayList of Bundle instances so that the returned list can be put to Bundle using putParcelableArrayList conveniently.
| Parameters | |
|---|---|
items: (Mutable)Collection<T!>! |
Collection of items to be bundled. |
toBundleFunc: Function<T!, Bundle!>! |
Function that specifies how to bundle each item. |
toBundleList
java-static fun <T : Any?> toBundleList(
list: (Mutable)List<T!>!,
toBundleFunc: Function<T!, Bundle!>!
): ImmutableList<Bundle!>!
Bundles a list of objects to a list of Bundle instances.
| Parameters | |
|---|---|
list: (Mutable)List<T!>! |
List of items to be bundled. |
toBundleFunc: Function<T!, Bundle!>! |
Function that specifies how to bundle each item. |
| Returns | |
|---|---|
ImmutableList<Bundle!>! |
The |
toBundleSparseArray
java-static fun <T : Any?> toBundleSparseArray(
items: SparseArray<T!>!,
toBundleFunc: Function<T!, Bundle!>!
): SparseArray<Bundle!>!
Bundles a SparseArray of objects to a SparseArray of Bundle instances so that the returned SparseArray can be put to Bundle using putSparseParcelableArray conveniently.
| Parameters | |
|---|---|
items: SparseArray<T!>! |
Collection of items to be bundled. |
toBundleFunc: Function<T!, Bundle!>! |
Function that specifies how to bundle each item. |
| Returns | |
|---|---|
SparseArray<Bundle!>! |
The |