package j$.time.temporal;

import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;

/* JADX INFO: loaded from: classes2.dex */
public final class x implements Serializable {
    private static final long serialVersionUID = -7317881728594519368L;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final long f19356a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final long f19358c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final long f19359d;

    public static x j(long j4, long j6) {
        if (j4 > j6) {
            throw new IllegalArgumentException("Minimum value must be less than maximum value");
        }
        return new x(j4, j4, j6, j6);
    }

    public static x k(long j4, long j6, long j7) {
        if (j4 > 1) {
            throw new IllegalArgumentException("Smallest minimum value must be less than largest minimum value");
        }
        if (j6 > j7) {
            throw new IllegalArgumentException("Smallest maximum value must be less than largest maximum value");
        }
        if (1 > j7) {
            throw new IllegalArgumentException("Minimum value must be less than maximum value");
        }
        return new x(j4, 1L, j6, j7);
    }

    private x(long j4, long j6, long j7, long j8) {
        this.f19356a = j4;
        this.f19357b = j6;
        this.f19358c = j7;
        this.f19359d = j8;
    }

    public final boolean g() {
        return this.f19356a == this.f19357b && this.f19358c == this.f19359d;
    }

    public final long e() {
        return this.f19356a;
    }

    public final long f() {
        return this.f19358c;
    }

    public final long d() {
        return this.f19359d;
    }

    public final boolean h() {
        return this.f19356a >= -2147483648L && this.f19359d <= 2147483647L;
    }

    public final boolean i(long j4) {
        return j4 >= this.f19356a && j4 <= this.f19359d;
    }

    public final int a(long j4, s sVar) {
        if (h() && i(j4)) {
            return (int) j4;
        }
        throw new j$.time.c(c(j4, sVar));
    }

    public final void b(long j4, s sVar) {
        if (!i(j4)) {
            throw new j$.time.c(c(j4, sVar));
        }
    }

    private String c(long j4, s sVar) {
        if (sVar != null) {
            return "Invalid value for " + sVar + " (valid values " + this + "): " + j4;
        }
        return "Invalid value (valid values " + this + "): " + j4;
    }

    private void readObject(ObjectInputStream objectInputStream) throws ClassNotFoundException, IOException {
        objectInputStream.defaultReadObject();
        long j4 = this.f19356a;
        long j6 = this.f19357b;
        if (j4 > j6) {
            throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value");
        }
        long j7 = this.f19358c;
        long j8 = this.f19359d;
        if (j7 > j8) {
            throw new InvalidObjectException("Smallest maximum value must be less than largest maximum value");
        }
        if (j6 > j8) {
            throw new InvalidObjectException("Minimum value must be less than maximum value");
        }
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof x) {
            x xVar = (x) obj;
            if (this.f19356a == xVar.f19356a && this.f19357b == xVar.f19357b && this.f19358c == xVar.f19358c && this.f19359d == xVar.f19359d) {
                return true;
            }
        }
        return false;
    }

    public final int hashCode() {
        long j4 = this.f19357b;
        long j6 = this.f19356a + (j4 << 16) + (j4 >> 48);
        long j7 = this.f19358c;
        long j8 = j6 + (j7 << 32) + (j7 >> 32);
        long j9 = this.f19359d;
        long j10 = j8 + (j9 << 48) + (j9 >> 16);
        return (int) ((j10 >>> 32) ^ j10);
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder();
        long j4 = this.f19356a;
        sb.append(j4);
        long j6 = this.f19357b;
        if (j4 != j6) {
            sb.append('/');
            sb.append(j6);
        }
        sb.append(" - ");
        long j7 = this.f19358c;
        sb.append(j7);
        long j8 = this.f19359d;
        if (j7 != j8) {
            sb.append('/');
            sb.append(j8);
        }
        return sb.toString();
    }
}
