package com.google.common.collect; import com.google.common.collect.ImmutableMap; import java.util.Collection; import java.util.Map; /* loaded from: classes.dex */ public abstract class ImmutableBiMap extends ImmutableMap implements BiMap { public static final class Builder extends ImmutableMap.Builder { public Builder() { } Builder(int i) { super(i); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.ImmutableMap.Builder public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Object obj, Object obj2) { a((Builder) obj, obj2); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Map.Entry entry) { a(entry); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Iterable iterable) { a(iterable); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public /* bridge */ /* synthetic */ ImmutableMap.Builder a(Map map) { a(map); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public Builder a(K k, V v) { super.a((Builder) k, (K) v); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public Builder a(Map.Entry entry) { super.a((Map.Entry) entry); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public Builder a(Map map) { super.a((Map) map); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public Builder a(Iterable> iterable) { super.a((Iterable) iterable); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public ImmutableBiMap a() { if (this.c == 0) { return ImmutableBiMap.of(); } b(); this.d = true; return new RegularImmutableBiMap(this.b, this.c); } } private static class SerializedForm extends ImmutableMap.SerializedForm { SerializedForm(ImmutableBiMap immutableBiMap) { super(immutableBiMap); } @Override // com.google.common.collect.ImmutableMap.SerializedForm Object readResolve() { return a(new Builder()); } } ImmutableBiMap() { } public static Builder builder() { return new Builder<>(); } public static ImmutableBiMap copyOf(Map map) { if (map instanceof ImmutableBiMap) { ImmutableBiMap immutableBiMap = (ImmutableBiMap) map; if (!immutableBiMap.isPartialView()) { return immutableBiMap; } } return copyOf((Iterable) map.entrySet()); } public static ImmutableBiMap of() { return RegularImmutableBiMap.f; } @Deprecated public V forcePut(K k, V v) { throw new UnsupportedOperationException(); } @Override // com.google.common.collect.BiMap public abstract ImmutableBiMap inverse(); @Override // com.google.common.collect.ImmutableMap Object writeReplace() { return new SerializedForm(this); } public static ImmutableBiMap of(K k, V v) { CollectPreconditions.a(k, v); return new RegularImmutableBiMap(new Object[]{k, v}, 1); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.google.common.collect.ImmutableMap public final ImmutableSet createValues() { throw new AssertionError("should never be called"); } public static ImmutableBiMap of(K k, V v, K k2, V v2) { CollectPreconditions.a(k, v); CollectPreconditions.a(k2, v2); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2}, 2); } @Override // com.google.common.collect.ImmutableMap, java.util.Map public ImmutableSet values() { return inverse().keySet(); } public static ImmutableBiMap copyOf(Iterable> iterable) { Builder builder = new Builder(iterable instanceof Collection ? ((Collection) iterable).size() : 4); builder.a((Iterable) iterable); return builder.a(); } public static ImmutableBiMap of(K k, V v, K k2, V v2, K k3, V v3) { CollectPreconditions.a(k, v); CollectPreconditions.a(k2, v2); CollectPreconditions.a(k3, v3); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3}, 3); } public static ImmutableBiMap of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4) { CollectPreconditions.a(k, v); CollectPreconditions.a(k2, v2); CollectPreconditions.a(k3, v3); CollectPreconditions.a(k4, v4); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3, k4, v4}, 4); } public static ImmutableBiMap of(K k, V v, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { CollectPreconditions.a(k, v); CollectPreconditions.a(k2, v2); CollectPreconditions.a(k3, v3); CollectPreconditions.a(k4, v4); CollectPreconditions.a(k5, v5); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3, k4, v4, k5, v5}, 5); } }