what-the-bank/sources/com/google/android/gms/internal/clearcut/zzdi.java

138 lines
3.6 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.clearcut;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/* loaded from: classes2.dex */
public final class zzdi<K, V> extends LinkedHashMap<K, V> {
private static final zzdi zzme;
private boolean zzfa;
public final void zzv() {
this.zzfa = false;
}
public final zzdi<K, V> zzca() {
return isEmpty() ? new zzdi<>() : new zzdi<>(this);
}
public final void zza(zzdi<K, V> zzdiVar) {
zzcb();
if (zzdiVar.isEmpty()) {
return;
}
putAll(zzdiVar);
}
@Override // java.util.HashMap, java.util.AbstractMap, java.util.Map
public final V remove(Object obj) {
zzcb();
return (V) super.remove(obj);
}
@Override // java.util.HashMap, java.util.AbstractMap, java.util.Map
public final void putAll(Map<? extends K, ? extends V> map) {
zzcb();
for (K k : map.keySet()) {
zzci.checkNotNull(k);
zzci.checkNotNull(map.get(k));
}
super.putAll(map);
}
@Override // java.util.HashMap, java.util.AbstractMap, java.util.Map
public final V put(K k, V v) {
zzcb();
zzci.checkNotNull(k);
zzci.checkNotNull(v);
return (V) super.put(k, v);
}
public final boolean isMutable() {
return this.zzfa;
}
@Override // java.util.AbstractMap, java.util.Map
public final int hashCode() {
int i = 0;
for (Map.Entry<K, V> entry : entrySet()) {
i += zzf(entry.getValue()) ^ zzf(entry.getKey());
}
return i;
}
@Override // java.util.AbstractMap, java.util.Map
public final boolean equals(Object obj) {
if (!(obj instanceof Map)) {
return false;
}
Map map = (Map) obj;
if (this == map) {
return true;
}
if (size() != map.size()) {
return false;
}
for (Map.Entry<K, V> entry : entrySet()) {
if (!map.containsKey(entry.getKey())) {
return false;
}
V value = entry.getValue();
Object obj2 = map.get(entry.getKey());
if (!(((value instanceof byte[]) && (obj2 instanceof byte[])) ? Arrays.equals((byte[]) value, (byte[]) obj2) : value.equals(obj2))) {
return false;
}
}
return true;
}
@Override // java.util.LinkedHashMap, java.util.HashMap, java.util.AbstractMap, java.util.Map
public final Set<Map.Entry<K, V>> entrySet() {
return isEmpty() ? Collections.emptySet() : super.entrySet();
}
@Override // java.util.LinkedHashMap, java.util.HashMap, java.util.AbstractMap, java.util.Map
public final void clear() {
zzcb();
super.clear();
}
private static int zzf(Object obj) {
if (obj instanceof byte[]) {
return zzci.hashCode((byte[]) obj);
}
if (obj instanceof zzcj) {
throw new UnsupportedOperationException();
}
return obj.hashCode();
}
private final void zzcb() {
if (!this.zzfa) {
throw new UnsupportedOperationException();
}
}
public static <K, V> zzdi<K, V> zzbz() {
return zzme;
}
private zzdi(Map<K, V> map) {
super(map);
this.zzfa = true;
}
private zzdi() {
this.zzfa = true;
}
static {
zzdi zzdiVar = new zzdi();
zzme = zzdiVar;
zzdiVar.zzfa = false;
}
}