package com.google.common.collect; import com.google.common.base.Ascii; import com.google.common.base.Equivalence; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import com.google.common.collect.MapMakerInternalMap; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /* loaded from: classes.dex */ public final class MapMaker { boolean a; int b = -1; int c = -1; MapMakerInternalMap.Strength d; MapMakerInternalMap.Strength e; Equivalence f; MapMaker a(Equivalence equivalence) { Preconditions.b(this.f == null, "key equivalence was already set to %s", this.f); Preconditions.a(equivalence); this.f = equivalence; this.a = true; return this; } public MapMaker b(int i) { Preconditions.b(this.b == -1, "initial capacity was already set to %s", this.b); Preconditions.a(i >= 0); this.b = i; return this; } Equivalence c() { return (Equivalence) MoreObjects.a(this.f, d().c()); } MapMakerInternalMap.Strength d() { return (MapMakerInternalMap.Strength) MoreObjects.a(this.d, MapMakerInternalMap.Strength.STRONG); } MapMakerInternalMap.Strength e() { return (MapMakerInternalMap.Strength) MoreObjects.a(this.e, MapMakerInternalMap.Strength.STRONG); } public ConcurrentMap f() { return !this.a ? new ConcurrentHashMap(b(), 0.75f, a()) : MapMakerInternalMap.a(this); } public MapMaker g() { a(MapMakerInternalMap.Strength.WEAK); return this; } public String toString() { MoreObjects.ToStringHelper a = MoreObjects.a(this); int i = this.b; if (i != -1) { a.a("initialCapacity", i); } int i2 = this.c; if (i2 != -1) { a.a("concurrencyLevel", i2); } MapMakerInternalMap.Strength strength = this.d; if (strength != null) { a.a("keyStrength", Ascii.a(strength.toString())); } MapMakerInternalMap.Strength strength2 = this.e; if (strength2 != null) { a.a("valueStrength", Ascii.a(strength2.toString())); } if (this.f != null) { a.a("keyEquivalence"); } return a.toString(); } public MapMaker a(int i) { Preconditions.b(this.c == -1, "concurrency level was already set to %s", this.c); Preconditions.a(i > 0); this.c = i; return this; } int b() { int i = this.b; if (i == -1) { return 16; } return i; } MapMaker b(MapMakerInternalMap.Strength strength) { Preconditions.b(this.e == null, "Value strength was already set to %s", this.e); Preconditions.a(strength); this.e = strength; if (strength != MapMakerInternalMap.Strength.STRONG) { this.a = true; } return this; } int a() { int i = this.c; if (i == -1) { return 4; } return i; } MapMaker a(MapMakerInternalMap.Strength strength) { Preconditions.b(this.d == null, "Key strength was already set to %s", this.d); Preconditions.a(strength); this.d = strength; if (strength != MapMakerInternalMap.Strength.STRONG) { this.a = true; } return this; } }