MutableCreationExtras
-
Cmn
class MutableCreationExtras : CreationExtras
| kotlin.Any | ||
| ↳ | androidx.lifecycle.viewmodel.CreationExtras | |
| ↳ | androidx.lifecycle.viewmodel.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 |
|
|---|---|
MutableCreationExtras(initialExtras: CreationExtras)Constructs a |
Cmn
|
Public functions |
||
|---|---|---|
open operator T? |
<T : Any?> get(key: CreationExtras.Key<T>)Returns the value to which the specified |
Cmn
|
operator Unit |
<T : Any?> set(key: CreationExtras.Key<T>, t: T)Associates the specified |
Cmn
|
Extension functions |
||
|---|---|---|
operator Unit |
MutableCreationExtras.plusAssign(creationExtras: CreationExtras)Appends or replaces all entries from the given |
Cmn
|
Inherited functions |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
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
MutableCreationExtras.plusAssign
operator fun MutableCreationExtras.plusAssign(creationExtras: CreationExtras): Unit
Appends or replaces all entries from the given creationExtras in this mutable extras.