package org.joda.time.chrono;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeZone;
import org.joda.time.chrono.AssembledChronology;

/* loaded from: classes5.dex */
public final class ISOChronology extends AssembledChronology {
    private static final ISOChronology Z;

    /* renamed from: a0, reason: collision with root package name */
    private static final ConcurrentHashMap f31980a0;
    private static final long serialVersionUID = -6212696554273812441L;

    /* loaded from: classes5.dex */
    private static final class Stub implements Serializable {
        private static final long serialVersionUID = -6212696554273812441L;

        /* renamed from: p, reason: collision with root package name */
        private transient DateTimeZone f31981p;

        Stub(DateTimeZone dateTimeZone) {
            this.f31981p = dateTimeZone;
        }

        private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
            this.f31981p = (DateTimeZone) objectInputStream.readObject();
        }

        private Object readResolve() {
            return ISOChronology.U(this.f31981p);
        }

        private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
            objectOutputStream.writeObject(this.f31981p);
        }
    }

    static {
        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        f31980a0 = concurrentHashMap;
        ISOChronology iSOChronology = new ISOChronology(GregorianChronology.N0());
        Z = iSOChronology;
        concurrentHashMap.put(DateTimeZone.f31852p, iSOChronology);
    }

    private ISOChronology(org.joda.time.a aVar) {
        super(aVar, null);
    }

    public static ISOChronology T() {
        return U(DateTimeZone.k());
    }

    public static ISOChronology U(DateTimeZone dateTimeZone) {
        if (dateTimeZone == null) {
            dateTimeZone = DateTimeZone.k();
        }
        ConcurrentHashMap concurrentHashMap = f31980a0;
        ISOChronology iSOChronology = (ISOChronology) concurrentHashMap.get(dateTimeZone);
        if (iSOChronology != null) {
            return iSOChronology;
        }
        ISOChronology iSOChronology2 = new ISOChronology(ZonedChronology.V(Z, dateTimeZone));
        ISOChronology iSOChronology3 = (ISOChronology) concurrentHashMap.putIfAbsent(dateTimeZone, iSOChronology2);
        return iSOChronology3 != null ? iSOChronology3 : iSOChronology2;
    }

    public static ISOChronology V() {
        return Z;
    }

    private Object writeReplace() {
        return new Stub(m());
    }

    @Override // org.joda.time.a
    public org.joda.time.a J() {
        return Z;
    }

    @Override // org.joda.time.a
    public org.joda.time.a K(DateTimeZone dateTimeZone) {
        if (dateTimeZone == null) {
            dateTimeZone = DateTimeZone.k();
        }
        return dateTimeZone == m() ? this : U(dateTimeZone);
    }

    @Override // org.joda.time.chrono.AssembledChronology
    protected void P(AssembledChronology.a aVar) {
        if (Q().m() == DateTimeZone.f31852p) {
            org.joda.time.field.c cVar = new org.joda.time.field.c(n.f32025r, DateTimeFieldType.x(), 100);
            aVar.H = cVar;
            aVar.f31927k = cVar.l();
            aVar.G = new org.joda.time.field.h((org.joda.time.field.c) aVar.H, DateTimeFieldType.V());
            aVar.C = new org.joda.time.field.h((org.joda.time.field.c) aVar.H, aVar.f31924h, DateTimeFieldType.T());
        }
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof ISOChronology) {
            return m().equals(((ISOChronology) obj).m());
        }
        return false;
    }

    public int hashCode() {
        return 800855 + m().hashCode();
    }

    @Override // org.joda.time.a
    public String toString() {
        DateTimeZone m10 = m();
        if (m10 == null) {
            return "ISOChronology";
        }
        return "ISOChronology[" + m10.n() + ']';
    }
}
