mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-28 18:12:31 -06:00
561 lines
49 KiB
Java
561 lines
49 KiB
Java
|
package kotlin.collections;
|
||
|
|
||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||
|
import androidx.exifinterface.media.ExifInterface;
|
||
|
import java.util.Collection;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.LinkedHashMap;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
import kotlin.Metadata;
|
||
|
import kotlin.Pair;
|
||
|
import kotlin.Unit;
|
||
|
import kotlin.jvm.functions.Function0;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
import kotlin.jvm.internal.Intrinsics;
|
||
|
import kotlin.jvm.internal.TypeIntrinsics;
|
||
|
import kotlin.sequences.Sequence;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* compiled from: Maps.kt */
|
||
|
@Metadata(d1 = {"\u0000~\n\u0000\n\u0002\u0010$\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010%\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010&\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\b\u0013\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010(\n\u0002\u0010)\n\u0002\u0010'\n\u0002\b\n\n\u0002\u0010\u001c\n\u0002\u0018\u0002\n\u0002\b\u0017\u001a`\u0010\u0000\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u00020\u00052%\b\u0001\u0010\u0006\u001a\u001f\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\b\u0012\u0004\u0012\u00020\t0\u0007¢\u0006\u0002\b\nH\u0087\bø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0002 \u0001\u001aX\u0010\u0000\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032%\b\u0001\u0010\u0006\u001a\u001f\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\b\u0012\u0004\u0012\u00020\t0\u0007¢\u0006\u0002\b\nH\u0087\bø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0001\u001a\u001e\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003\u001a1\u0010\f\u001a\u001e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\rj\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u0003`\u000e\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003H\u0087\b\u001a_\u0010\f\u001a\u001e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\rj\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u0003`\u000e\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032*\u0010\u000f\u001a\u0016\u0012\u0012\b\u0001\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u00110\u0010\"\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0011¢\u0006\u0002\u0010\u0012\u001a1\u0010\u0013\u001a\u001e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0014j\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u0003`\u0015\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003H\u0087\b\u001a_\u0010\u0013\u001a\u001e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0014j\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u0003`\u0015\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032*\u0010\u000f\u001a\u0016\u0012\u0012\b\u0001\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u00110\u0010\"\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0011¢\u0006\u0002\u0010\u0016\u001a!\u0010\u0017\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003H\u0087\b\u001aO\u0010\u0017\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032*\u0010\u000f\u001a\u0016\u0012\u0012\b\u0001\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u00110\u0010\"\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0011¢\u0006\u0002\u0010\u0018\u001a!\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\b\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003H\u0087\b\u001aO\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\b\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032*\u0010\u000f\u001a\u0016\u0012\u0012\b\u0001\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u00110\u0010\"\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00030\u0011¢\u0006\u0002\u00
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class MapsKt__MapsKt extends MapsKt__MapsJVMKt {
|
||
|
public static final <K, V> Map<K, V> emptyMap() {
|
||
|
EmptyMap emptyMap = EmptyMap.INSTANCE;
|
||
|
Intrinsics.checkNotNull(emptyMap, "null cannot be cast to non-null type kotlin.collections.Map<K of kotlin.collections.MapsKt__MapsKt.emptyMap, V of kotlin.collections.MapsKt__MapsKt.emptyMap>");
|
||
|
return emptyMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> mapOf(Pair<? extends K, ? extends V>... pairs) {
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
return pairs.length > 0 ? MapsKt.toMap(pairs, new LinkedHashMap(MapsKt.mapCapacity(pairs.length))) : MapsKt.emptyMap();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Map<K, V> mapOf() {
|
||
|
return MapsKt.emptyMap();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Map<K, V> mutableMapOf() {
|
||
|
return new LinkedHashMap();
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> mutableMapOf(Pair<? extends K, ? extends V>... pairs) {
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(MapsKt.mapCapacity(pairs.length));
|
||
|
MapsKt.putAll(linkedHashMap, pairs);
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
private static final <K, V> HashMap<K, V> hashMapOf() {
|
||
|
return new HashMap<>();
|
||
|
}
|
||
|
|
||
|
public static final <K, V> HashMap<K, V> hashMapOf(Pair<? extends K, ? extends V>... pairs) {
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
HashMap<K, V> hashMap = new HashMap<>(MapsKt.mapCapacity(pairs.length));
|
||
|
MapsKt.putAll(hashMap, pairs);
|
||
|
return hashMap;
|
||
|
}
|
||
|
|
||
|
private static final <K, V> LinkedHashMap<K, V> linkedMapOf() {
|
||
|
return new LinkedHashMap<>();
|
||
|
}
|
||
|
|
||
|
public static final <K, V> LinkedHashMap<K, V> linkedMapOf(Pair<? extends K, ? extends V>... pairs) {
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
return (LinkedHashMap) MapsKt.toMap(pairs, new LinkedHashMap(MapsKt.mapCapacity(pairs.length)));
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Map<K, V> buildMap(Function1<? super Map<K, V>, Unit> builderAction) {
|
||
|
Intrinsics.checkNotNullParameter(builderAction, "builderAction");
|
||
|
Map createMapBuilder = MapsKt.createMapBuilder();
|
||
|
builderAction.invoke(createMapBuilder);
|
||
|
return MapsKt.build(createMapBuilder);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Map<K, V> buildMap(int i, Function1<? super Map<K, V>, Unit> builderAction) {
|
||
|
Intrinsics.checkNotNullParameter(builderAction, "builderAction");
|
||
|
Map createMapBuilder = MapsKt.createMapBuilder(i);
|
||
|
builderAction.invoke(createMapBuilder);
|
||
|
return MapsKt.build(createMapBuilder);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> boolean isNotEmpty(Map<? extends K, ? extends V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return !map.isEmpty();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> boolean isNullOrEmpty(Map<? extends K, ? extends V> map) {
|
||
|
return map == null || map.isEmpty();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
private static final <K, V> Map<K, V> orEmpty(Map<K, ? extends V> map) {
|
||
|
return map == 0 ? MapsKt.emptyMap() : map;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Incorrect types in method signature: <M::Ljava/util/Map<**>;:TR;R:Ljava/lang/Object;>(TM;Lkotlin/jvm/functions/Function0<+TR;>;)TR; */
|
||
|
private static final Object ifEmpty(Map map, Function0 defaultValue) {
|
||
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
||
|
return map.isEmpty() ? defaultValue.invoke() : map;
|
||
|
}
|
||
|
|
||
|
private static final <K, V> boolean contains(Map<? extends K, ? extends V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.containsKey(k);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> V get(Map<? extends K, ? extends V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.get(k);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void set(Map<K, V> map, K k, V v) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
map.put(k, v);
|
||
|
}
|
||
|
|
||
|
private static final <K> boolean containsKey(Map<? extends K, ?> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.containsKey(k);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> boolean containsValue(Map<K, ? extends V> map, V v) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.containsValue(v);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> V remove(Map<? extends K, V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return (V) TypeIntrinsics.asMutableMap(map).remove(k);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> K component1(Map.Entry<? extends K, ? extends V> entry) {
|
||
|
Intrinsics.checkNotNullParameter(entry, "<this>");
|
||
|
return entry.getKey();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> V component2(Map.Entry<? extends K, ? extends V> entry) {
|
||
|
Intrinsics.checkNotNullParameter(entry, "<this>");
|
||
|
return entry.getValue();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Pair<K, V> toPair(Map.Entry<? extends K, ? extends V> entry) {
|
||
|
Intrinsics.checkNotNullParameter(entry, "<this>");
|
||
|
return new Pair<>(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
|
||
|
private static final <K, V> V getOrElse(Map<K, ? extends V> map, K k, Function0<? extends V> defaultValue) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
||
|
V v = map.get(k);
|
||
|
return v == null ? defaultValue.invoke() : v;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> V getOrElseNullable(Map<K, ? extends V> map, K k, Function0<? extends V> defaultValue) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
||
|
V v = map.get(k);
|
||
|
return (v != null || map.containsKey(k)) ? v : defaultValue.invoke();
|
||
|
}
|
||
|
|
||
|
public static final <K, V> V getValue(Map<K, ? extends V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return (V) MapsKt.getOrImplicitDefaultNullable(map, k);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> V getOrPut(Map<K, V> map, K k, Function0<? extends V> defaultValue) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
||
|
V v = map.get(k);
|
||
|
if (v != null) {
|
||
|
return v;
|
||
|
}
|
||
|
V invoke = defaultValue.invoke();
|
||
|
map.put(k, invoke);
|
||
|
return invoke;
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Iterator<Map.Entry<K, V>> iterator(Map<? extends K, ? extends V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.entrySet().iterator();
|
||
|
}
|
||
|
|
||
|
private static final <K, V> Iterator<Map.Entry<K, V>> mutableIterator(Map<K, V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return map.entrySet().iterator();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <K, V, R, M extends Map<? super K, ? super R>> M mapValuesTo(Map<? extends K, ? extends V> map, M destination, Function1<? super Map.Entry<? extends K, ? extends V>, ? extends R> transform) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
||
|
Iterator<T> it = map.entrySet().iterator();
|
||
|
while (it.hasNext()) {
|
||
|
Map.Entry entry = (Object) it.next();
|
||
|
destination.put(entry.getKey(), transform.invoke(entry));
|
||
|
}
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <K, V, R, M extends Map<? super R, ? super V>> M mapKeysTo(Map<? extends K, ? extends V> map, M destination, Function1<? super Map.Entry<? extends K, ? extends V>, ? extends R> transform) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
||
|
Iterator<T> it = map.entrySet().iterator();
|
||
|
while (it.hasNext()) {
|
||
|
Map.Entry entry = (Object) it.next();
|
||
|
destination.put(transform.invoke(entry), entry.getValue());
|
||
|
}
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> void putAll(Map<? super K, ? super V> map, Pair<? extends K, ? extends V>[] pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
for (Pair<? extends K, ? extends V> pair : pairs) {
|
||
|
map.put(pair.component1(), pair.component2());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static final <K, V> void putAll(Map<? super K, ? super V> map, Iterable<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
for (Pair<? extends K, ? extends V> pair : pairs) {
|
||
|
map.put(pair.component1(), pair.component2());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static final <K, V> void putAll(Map<? super K, ? super V> map, Sequence<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
for (Pair<? extends K, ? extends V> pair : pairs) {
|
||
|
map.put(pair.component1(), pair.component2());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <K, V, R> Map<K, R> mapValues(Map<? extends K, ? extends V> map, Function1<? super Map.Entry<? extends K, ? extends V>, ? extends R> transform) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(MapsKt.mapCapacity(map.size()));
|
||
|
Iterator<T> it = map.entrySet().iterator();
|
||
|
while (it.hasNext()) {
|
||
|
Map.Entry entry = (Object) it.next();
|
||
|
linkedHashMap.put(entry.getKey(), transform.invoke(entry));
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <K, V, R> Map<R, V> mapKeys(Map<? extends K, ? extends V> map, Function1<? super Map.Entry<? extends K, ? extends V>, ? extends R> transform) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(MapsKt.mapCapacity(map.size()));
|
||
|
Iterator<T> it = map.entrySet().iterator();
|
||
|
while (it.hasNext()) {
|
||
|
Map.Entry entry = (Object) it.next();
|
||
|
linkedHashMap.put(transform.invoke(entry), entry.getValue());
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> filterKeys(Map<? extends K, ? extends V> map, Function1<? super K, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (predicate.invoke(entry.getKey()).booleanValue()) {
|
||
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> filterValues(Map<? extends K, ? extends V> map, Function1<? super V, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (predicate.invoke(entry.getValue()).booleanValue()) {
|
||
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M filterTo(Map<? extends K, ? extends V> map, M destination, Function1<? super Map.Entry<? extends K, ? extends V>, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (predicate.invoke(entry).booleanValue()) {
|
||
|
destination.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> filter(Map<? extends K, ? extends V> map, Function1<? super Map.Entry<? extends K, ? extends V>, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (predicate.invoke(entry).booleanValue()) {
|
||
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M filterNotTo(Map<? extends K, ? extends V> map, M destination, Function1<? super Map.Entry<? extends K, ? extends V>, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (!predicate.invoke(entry).booleanValue()) {
|
||
|
destination.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> filterNot(Map<? extends K, ? extends V> map, Function1<? super Map.Entry<? extends K, ? extends V>, Boolean> predicate) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||
|
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
|
||
|
if (!predicate.invoke(entry).booleanValue()) {
|
||
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
||
|
}
|
||
|
}
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> toMap(Iterable<? extends Pair<? extends K, ? extends V>> iterable) {
|
||
|
Intrinsics.checkNotNullParameter(iterable, "<this>");
|
||
|
if (iterable instanceof Collection) {
|
||
|
Collection collection = (Collection) iterable;
|
||
|
int size = collection.size();
|
||
|
if (size == 0) {
|
||
|
return MapsKt.emptyMap();
|
||
|
}
|
||
|
if (size != 1) {
|
||
|
return MapsKt.toMap(iterable, new LinkedHashMap(MapsKt.mapCapacity(collection.size())));
|
||
|
}
|
||
|
return MapsKt.mapOf(iterable instanceof List ? (Pair<? extends K, ? extends V>) ((List) iterable).get(0) : iterable.iterator().next());
|
||
|
}
|
||
|
return MapsKt.optimizeReadOnlyMap(MapsKt.toMap(iterable, new LinkedHashMap()));
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M toMap(Iterable<? extends Pair<? extends K, ? extends V>> iterable, M destination) {
|
||
|
Intrinsics.checkNotNullParameter(iterable, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
MapsKt.putAll(destination, iterable);
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> toMap(Pair<? extends K, ? extends V>[] pairArr) {
|
||
|
Intrinsics.checkNotNullParameter(pairArr, "<this>");
|
||
|
int length = pairArr.length;
|
||
|
if (length == 0) {
|
||
|
return MapsKt.emptyMap();
|
||
|
}
|
||
|
if (length == 1) {
|
||
|
return MapsKt.mapOf(pairArr[0]);
|
||
|
}
|
||
|
return MapsKt.toMap(pairArr, new LinkedHashMap(MapsKt.mapCapacity(pairArr.length)));
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M toMap(Pair<? extends K, ? extends V>[] pairArr, M destination) {
|
||
|
Intrinsics.checkNotNullParameter(pairArr, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
MapsKt.putAll(destination, pairArr);
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> toMap(Sequence<? extends Pair<? extends K, ? extends V>> sequence) {
|
||
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||
|
return MapsKt.optimizeReadOnlyMap(MapsKt.toMap(sequence, new LinkedHashMap()));
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M toMap(Sequence<? extends Pair<? extends K, ? extends V>> sequence, M destination) {
|
||
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
MapsKt.putAll(destination, sequence);
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> toMap(Map<? extends K, ? extends V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
int size = map.size();
|
||
|
if (size == 0) {
|
||
|
return MapsKt.emptyMap();
|
||
|
}
|
||
|
if (size == 1) {
|
||
|
return MapsKt.toSingletonMap(map);
|
||
|
}
|
||
|
return MapsKt.toMutableMap(map);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> toMutableMap(Map<? extends K, ? extends V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
return new LinkedHashMap(map);
|
||
|
}
|
||
|
|
||
|
public static final <K, V, M extends Map<? super K, ? super V>> M toMap(Map<? extends K, ? extends V> map, M destination) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(destination, "destination");
|
||
|
destination.putAll(map);
|
||
|
return destination;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> plus(Map<? extends K, ? extends V> map, Pair<? extends K, ? extends V> pair) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pair, "pair");
|
||
|
if (map.isEmpty()) {
|
||
|
return MapsKt.mapOf(pair);
|
||
|
}
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
||
|
linkedHashMap.put(pair.getFirst(), pair.getSecond());
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> plus(Map<? extends K, ? extends V> map, Iterable<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
if (map.isEmpty()) {
|
||
|
return MapsKt.toMap(pairs);
|
||
|
}
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
||
|
MapsKt.putAll(linkedHashMap, pairs);
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> plus(Map<? extends K, ? extends V> map, Pair<? extends K, ? extends V>[] pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
if (map.isEmpty()) {
|
||
|
return MapsKt.toMap(pairs);
|
||
|
}
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
||
|
MapsKt.putAll(linkedHashMap, pairs);
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> plus(Map<? extends K, ? extends V> map, Sequence<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
||
|
MapsKt.putAll(linkedHashMap, pairs);
|
||
|
return MapsKt.optimizeReadOnlyMap(linkedHashMap);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> plus(Map<? extends K, ? extends V> map, Map<? extends K, ? extends V> map2) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(map2, "map");
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
||
|
linkedHashMap.putAll(map2);
|
||
|
return linkedHashMap;
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void plusAssign(Map<? super K, ? super V> map, Pair<? extends K, ? extends V> pair) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pair, "pair");
|
||
|
map.put(pair.getFirst(), pair.getSecond());
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void plusAssign(Map<? super K, ? super V> map, Iterable<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
MapsKt.putAll(map, pairs);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void plusAssign(Map<? super K, ? super V> map, Pair<? extends K, ? extends V>[] pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
MapsKt.putAll(map, pairs);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void plusAssign(Map<? super K, ? super V> map, Sequence<? extends Pair<? extends K, ? extends V>> pairs) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(pairs, "pairs");
|
||
|
MapsKt.putAll(map, pairs);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
private static final <K, V> void plusAssign(Map<? super K, ? super V> map, Map<K, ? extends V> map2) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(map2, "map");
|
||
|
map.putAll(map2);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> minus(Map<? extends K, ? extends V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Map mutableMap = MapsKt.toMutableMap(map);
|
||
|
mutableMap.remove(k);
|
||
|
return MapsKt.optimizeReadOnlyMap(mutableMap);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> minus(Map<? extends K, ? extends V> map, Iterable<? extends K> keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
Map mutableMap = MapsKt.toMutableMap(map);
|
||
|
CollectionsKt.removeAll(mutableMap.keySet(), keys);
|
||
|
return MapsKt.optimizeReadOnlyMap(mutableMap);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> minus(Map<? extends K, ? extends V> map, K[] keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
Map mutableMap = MapsKt.toMutableMap(map);
|
||
|
CollectionsKt.removeAll(mutableMap.keySet(), keys);
|
||
|
return MapsKt.optimizeReadOnlyMap(mutableMap);
|
||
|
}
|
||
|
|
||
|
public static final <K, V> Map<K, V> minus(Map<? extends K, ? extends V> map, Sequence<? extends K> keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
Map mutableMap = MapsKt.toMutableMap(map);
|
||
|
CollectionsKt.removeAll(mutableMap.keySet(), keys);
|
||
|
return MapsKt.optimizeReadOnlyMap(mutableMap);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void minusAssign(Map<K, V> map, K k) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
map.remove(k);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void minusAssign(Map<K, V> map, Iterable<? extends K> keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
CollectionsKt.removeAll(map.keySet(), keys);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void minusAssign(Map<K, V> map, K[] keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
CollectionsKt.removeAll(map.keySet(), keys);
|
||
|
}
|
||
|
|
||
|
private static final <K, V> void minusAssign(Map<K, V> map, Sequence<? extends K> keys) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
Intrinsics.checkNotNullParameter(keys, "keys");
|
||
|
CollectionsKt.removeAll(map.keySet(), keys);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <K, V> Map<K, V> optimizeReadOnlyMap(Map<K, ? extends V> map) {
|
||
|
Intrinsics.checkNotNullParameter(map, "<this>");
|
||
|
int size = map.size();
|
||
|
if (size != 0) {
|
||
|
return size != 1 ? map : MapsKt.toSingletonMap(map);
|
||
|
}
|
||
|
return MapsKt.emptyMap();
|
||
|
}
|
||
|
}
|