{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

MutableCreationExtras

public final class MutableCreationExtras extends CreationExtras

java.lang.Object
   ↳ androidx.lifecycle.viewmodel.CreationExtras
     ↳ androidx.lifecycle.viewmodel.MutableCreationExtras

Mutable implementation of CreationExtras

Summary

Public constructors

Public methods

T
<T extends Object> get(@NonNull CreationExtras.Key<@NonNull T> key)

Returns an element associated with the given key

final void
<T extends Object> set(@NonNull CreationExtras.Key<@NonNull T> key, @NonNull T t)

Associates the given key with t

Public constructors

MutableCreationExtras

public MutableCreationExtras(@NonNull CreationExtras initialExtras)
Parameters
@NonNull CreationExtras initialExtras

extras that will be filled into the resulting MutableCreationExtras

Public methods

get

public T <T extends Object> get(@NonNull CreationExtras.Key<@NonNull T> key)

Returns an element associated with the given key

set

public final void <T extends Object> set(@NonNull CreationExtras.Key<@NonNull T> key, @NonNull T t)

Associates the given key with t