MutableCreationExtras



A modifiable CreationExtras that holds pairs of CreationExtras.Key and Any, allowing efficient value retrieval for each key.

Each key in CreationExtras is unique, storing only one value per key.

See also
CreationExtras

Summary

Public constructors

Constructs a MutableCreationExtras containing the elements of the specified initialExtras, in the order they are returned by the CreationExtras's iterator.

Cmn

Public functions

open operator T?
<T : Any?> get(key: CreationExtras.Key<T>)

Returns the value to which the specified key is associated, or null if this CreationExtras contains no mapping for the key.

Cmn
operator Unit
<T : Any?> set(key: CreationExtras.Key<T>, t: T)

Associates the specified t with the specified key in this CreationExtras.

Cmn

Extension functions

operator Unit

Appends or replaces all entries from the given creationExtras in this mutable extras.

Cmn

Inherited functions

From androidx.lifecycle.viewmodel.CreationExtras
open operator Boolean
equals(other: Any?)

Compares the specified object with this CreationExtras for equality.

Cmn
open Int

Returns the hash code value for this CreationExtras.

Cmn
open String

Returns a string representation of this CreationExtras.

Cmn

Public constructors

MutableCreationExtras

MutableCreationExtras(initialExtras: CreationExtras = Empty)

Constructs a MutableCreationExtras containing the elements of the specified initialExtras, in the order they are returned by the CreationExtras's iterator.

Public functions

get

open operator fun <T : Any?> get(key: CreationExtras.Key<T>): T?

Returns the value to which the specified key is associated, or null if this CreationExtras contains no mapping for the key.

set

operator fun <T : Any?> set(key: CreationExtras.Key<T>, t: T): Unit

Associates the specified t with the specified key in this CreationExtras.

Extension functions

operator fun MutableCreationExtras.plusAssign(creationExtras: CreationExtras): Unit

Appends or replaces all entries from the given creationExtras in this mutable extras.