package com.google.android.gms.internal.gtm; 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 zzse extends LinkedHashMap { private static final zzse zzbct; private boolean zzavs; private zzse() { this.zzavs = true; } private zzse(Map map) { super(map); this.zzavs = true; } public final void zza(zzse zzseVar) { zzqh(); if (zzseVar.isEmpty()) { return; } putAll(zzseVar); } @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() { zzqh(); super.clear(); } @Override // java.util.HashMap, java.util.AbstractMap, java.util.Map public final V put(K k, V v) { zzqh(); zzre.checkNotNull(k); zzre.checkNotNull(v); return (V) super.put(k, v); } @Override // java.util.HashMap, java.util.AbstractMap, java.util.Map public final void putAll(Map map) { zzqh(); for (K k : map.keySet()) { zzre.checkNotNull(k); zzre.checkNotNull(map.get(k)); } super.putAll(map); } @Override // java.util.HashMap, java.util.AbstractMap, java.util.Map public final V remove(Object obj) { zzqh(); return (V) super.remove(obj); } @Override // java.util.AbstractMap, java.util.Map public final boolean equals(Object obj) { boolean equals; 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[])) { equals = Arrays.equals((byte[]) value, (byte[]) obj2); } else { equals = value.equals(obj2); } if (!equals) { return false; } } return true; } private static int zzw(Object obj) { if (obj instanceof byte[]) { return zzre.hashCode((byte[]) obj); } if (obj instanceof zzrf) { throw new UnsupportedOperationException(); } return obj.hashCode(); } @Override // java.util.AbstractMap, java.util.Map public final int hashCode() { int i = 0; for (Map.Entry entry : entrySet()) { i += zzw(entry.getValue()) ^ zzw(entry.getKey()); } return i; } public final zzse zzqg() { return isEmpty() ? new zzse<>() : new zzse<>(this); } private final void zzqh() { if (!this.zzavs) { throw new UnsupportedOperationException(); } } static { zzse zzseVar = new zzse(); zzbct = zzseVar; zzseVar.zzavs = false; } public final void zzmi() { this.zzavs = false; } public final boolean isMutable() { return this.zzavs; } public static zzse zzqf() { return zzbct; } }