package androidx.lifecycle; import androidx.annotation.RestrictTo; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes.dex */ public class ViewModelStore { private final Map map = new LinkedHashMap(); @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public final void put(String key, ViewModel viewModel) { Intrinsics.checkNotNullParameter(key, "key"); Intrinsics.checkNotNullParameter(viewModel, "viewModel"); ViewModel put = this.map.put(key, viewModel); if (put != null) { put.onCleared(); } } @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public final ViewModel get(String key) { Intrinsics.checkNotNullParameter(key, "key"); return this.map.get(key); } @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public final Set keys() { return new HashSet(this.map.keySet()); } public final void clear() { Iterator it = this.map.values().iterator(); while (it.hasNext()) { it.next().clear(); } this.map.clear(); } }