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 extends LinkedHashMap { private static final zzdi zzme; private boolean zzfa; public final void zzv() { this.zzfa = false; } public final zzdi zzca() { return isEmpty() ? new zzdi<>() : new zzdi<>(this); } public final void zza(zzdi 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 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 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 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> 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 zzdi zzbz() { return zzme; } private zzdi(Map map) { super(map); this.zzfa = true; } private zzdi() { this.zzfa = true; } static { zzdi zzdiVar = new zzdi(); zzme = zzdiVar; zzdiVar.zzfa = false; } }