PersistableBundleKt

Added in 1.1.0

public final class PersistableBundleKt


Summary

Public methods

static final @NonNull PersistableBundle

Returns a new empty PersistableBundle.

static final @NonNull PersistableBundle

Returns a new PersistableBundle with the given key/value pairs as elements.

static final @NonNull PersistableBundle

Covert this map to a PersistableBundle with the key/value pairs as elements.

Public methods

persistableBundleOf

@RequiresApi(value = 21)
public static final @NonNull PersistableBundle persistableBundleOf()

Returns a new empty PersistableBundle.

persistableBundleOf

@RequiresApi(value = 21)
public static final @NonNull PersistableBundle persistableBundleOf(@NonNull Pair<@NonNull StringObject> pairs)

Returns a new PersistableBundle with the given key/value pairs as elements.

Supported value types are Int, Long, Double, and String and arrays of these types. On API 22 and later Boolean and BooleanArray are also supported.

Throws
kotlin.IllegalArgumentException

When a value is not a supported type of PersistableBundle.

toPersistableBundle

@RequiresApi(value = 21)
public static final @NonNull PersistableBundle toPersistableBundle(@NonNull Map<@NonNull StringObject> receiver)

Covert this map to a PersistableBundle with the key/value pairs as elements.

Supported value types are Int, Long, Double, and String and arrays of these types. On API 22 and later Boolean and BooleanArray are also supported.

Throws
kotlin.IllegalArgumentException

When a value is not a supported type of PersistableBundle.