package com.google.common.collect; import com.google.common.collect.ImmutableMap; import java.util.Collection; import java.util.Comparator; import java.util.Map; /* loaded from: classes2.dex */ public abstract class ImmutableBiMap extends ImmutableMap implements BiMap { @Override // com.google.common.collect.BiMap public abstract ImmutableBiMap inverse(); public static ImmutableBiMap of() { return RegularImmutableBiMap.EMPTY; } public static ImmutableBiMap of(K k, V v) { CollectPreconditions.checkEntryNotNull(k, v); return new RegularImmutableBiMap(new Object[]{k, v}, 1); } public static ImmutableBiMap of(K k, V v, K k2, V v2) { CollectPreconditions.checkEntryNotNull(k, v); CollectPreconditions.checkEntryNotNull(k2, v2); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2}, 2); } public static ImmutableBiMap of(K k, V v, K k2, V v2, K k3, V v3) { CollectPreconditions.checkEntryNotNull(k, v); CollectPreconditions.checkEntryNotNull(k2, v2); CollectPreconditions.checkEntryNotNull(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.checkEntryNotNull(k, v); CollectPreconditions.checkEntryNotNull(k2, v2); CollectPreconditions.checkEntryNotNull(k3, v3); CollectPreconditions.checkEntryNotNull(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.checkEntryNotNull(k, v); CollectPreconditions.checkEntryNotNull(k2, v2); CollectPreconditions.checkEntryNotNull(k3, v3); CollectPreconditions.checkEntryNotNull(k4, v4); CollectPreconditions.checkEntryNotNull(k5, v5); return new RegularImmutableBiMap(new Object[]{k, v, k2, v2, k3, v3, k4, v4, k5, v5}, 5); } public static Builder builder() { return new Builder<>(); } public static Builder builderWithExpectedSize(int i) { CollectPreconditions.checkNonnegative(i, "expectedSize"); return new Builder<>(i); } /* loaded from: classes2.dex */ public static final class Builder extends ImmutableMap.Builder { /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.ImmutableMap.Builder public final /* bridge */ /* synthetic */ ImmutableMap.Builder put(Object obj, Object obj2) { return put((Builder) obj, obj2); } public Builder() { } Builder(int i) { super(i); } @Override // com.google.common.collect.ImmutableMap.Builder public final Builder put(K k, V v) { super.put((Builder) k, (K) v); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public final Builder put(Map.Entry entry) { super.put((Map.Entry) entry); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public final Builder putAll(Map map) { super.putAll((Map) map); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public final Builder putAll(Iterable> iterable) { super.putAll((Iterable) iterable); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public final Builder orderEntriesByValue(Comparator comparator) { super.orderEntriesByValue((Comparator) comparator); return this; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.google.common.collect.ImmutableMap.Builder public final Builder combine(ImmutableMap.Builder builder) { super.combine((ImmutableMap.Builder) builder); return this; } @Override // com.google.common.collect.ImmutableMap.Builder public final ImmutableBiMap build() { if (this.size == 0) { return ImmutableBiMap.of(); } sortEntries(); this.entriesUsed = true; return new RegularImmutableBiMap(this.alternatingKeysAndValues, this.size); } } 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 copyOf(Iterable> iterable) { return new Builder(iterable instanceof Collection ? ((Collection) iterable).size() : 4).putAll((Iterable) iterable).build(); } @Override // com.google.common.collect.ImmutableMap, java.util.Map public ImmutableSet values() { return inverse().keySet(); } /* 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"); } @Override // com.google.common.collect.BiMap @Deprecated public final V forcePut(K k, V v) { throw new UnsupportedOperationException(); } /* loaded from: classes2.dex */ static class SerializedForm extends ImmutableMap.SerializedForm { private static final long serialVersionUID = 0; SerializedForm(ImmutableBiMap immutableBiMap) { super(immutableBiMap); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.google.common.collect.ImmutableMap.SerializedForm public Builder makeBuilder(int i) { return new Builder<>(i); } } @Override // com.google.common.collect.ImmutableMap Object writeReplace() { return new SerializedForm(this); } }