package j$.time.temporal;

import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/* JADX INFO: loaded from: classes2.dex */
public final class z implements Serializable {

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static final ConcurrentHashMap f19369g = new ConcurrentHashMap(4, 0.75f, 2);

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final v f19370h;
    private static final long serialVersionUID = -1177360819670808121L;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final j$.time.e f19371a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final int f19372b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final transient s f19373c = y.e(this);

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final transient s f19374d = y.h(this);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final transient s f19375e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final transient s f19376f;

    static {
        new z(j$.time.e.MONDAY, 4);
        g(j$.time.e.SUNDAY, 1);
        f19370h = j.f19340d;
    }

    public static z g(j$.time.e eVar, int i6) {
        String str = eVar.toString() + i6;
        ConcurrentHashMap concurrentHashMap = f19369g;
        z zVar = (z) concurrentHashMap.get(str);
        if (zVar != null) {
            return zVar;
        }
        concurrentHashMap.putIfAbsent(str, new z(eVar, i6));
        return (z) concurrentHashMap.get(str);
    }

    private z(j$.time.e eVar, int i6) {
        b bVar = b.NANOS;
        this.f19375e = y.i(this);
        this.f19376f = y.g(this);
        Objects.requireNonNull(eVar, "firstDayOfWeek");
        if (i6 < 1 || i6 > 7) {
            throw new IllegalArgumentException("Minimal number of days is invalid");
        }
        this.f19371a = eVar;
        this.f19372b = i6;
    }

    private void readObject(ObjectInputStream objectInputStream) throws ClassNotFoundException, IOException {
        objectInputStream.defaultReadObject();
        if (this.f19371a == null) {
            throw new InvalidObjectException("firstDayOfWeek is null");
        }
        int i6 = this.f19372b;
        if (i6 < 1 || i6 > 7) {
            throw new InvalidObjectException("Minimal number of days is invalid");
        }
    }

    private Object readResolve() throws InvalidObjectException {
        try {
            return g(this.f19371a, this.f19372b);
        } catch (IllegalArgumentException e6) {
            throw new InvalidObjectException("Invalid serialized WeekFields: " + e6.getMessage());
        }
    }

    public final j$.time.e e() {
        return this.f19371a;
    }

    public final int f() {
        return this.f19372b;
    }

    public final s d() {
        return this.f19373c;
    }

    public final s i() {
        return this.f19374d;
    }

    public final s j() {
        return this.f19375e;
    }

    public final s h() {
        return this.f19376f;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj instanceof z) && hashCode() == obj.hashCode();
    }

    public final int hashCode() {
        return (this.f19371a.ordinal() * 7) + this.f19372b;
    }

    public final String toString() {
        return "WeekFields[" + this.f19371a + "," + this.f19372b + "]";
    }
}
