what-the-bank/sources/o/gsF.java

376 lines
13 KiB
Java

package o;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectStreamException;
import java.io.Serializable;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.temporal.UnsupportedTemporalTypeException;
/* loaded from: classes6.dex */
public final class gsF extends gtE implements InterfaceC15536gtL, gtJ, Comparable<gsF>, Serializable {
public static final int MAX_VALUE = 999999999;
public static final int MIN_VALUE = -999999999;
private static final long serialVersionUID = -23038383694477807L;
private final int year;
public static final gtQ<gsF> FROM = new gtQ<gsF>() { // from class: o.gsF.4
@Override // o.gtQ
public final gsF queryFrom(gtK gtk) {
return gsF.from(gtk);
}
};
private static final C15554gto PARSER = new C15553gtn().appendValue(EnumC15534gtD.YEAR, 4, 10, EnumC15564gty.EXCEEDS_PAD).toFormatter();
public static gsF now() {
return now(AbstractC15514gsj.systemDefaultZone());
}
public static gsF now(AbstractC15502gsH abstractC15502gsH) {
return now(AbstractC15514gsj.system(abstractC15502gsH));
}
public static gsF now(AbstractC15514gsj abstractC15514gsj) {
return of(C15520gsp.now(abstractC15514gsj).getYear());
}
public static gsF of(int i) {
EnumC15534gtD.YEAR.checkValidValue(i);
return new gsF(i);
}
public static gsF from(gtK gtk) {
if (gtk instanceof gsF) {
return (gsF) gtk;
}
try {
if (!gsV.INSTANCE.equals(gsR.from(gtk))) {
gtk = C15520gsp.from(gtk);
}
return of(gtk.get(EnumC15534gtD.YEAR));
} catch (DateTimeException unused) {
StringBuilder sb = new StringBuilder("Unable to obtain Year from TemporalAccessor: ");
sb.append(gtk);
sb.append(", type ");
sb.append(gtk.getClass().getName());
throw new DateTimeException(sb.toString());
}
}
public static gsF parse(CharSequence charSequence) {
return parse(charSequence, PARSER);
}
public static gsF parse(CharSequence charSequence, C15554gto c15554gto) {
gtG.requireNonNull(c15554gto, "formatter");
return (gsF) c15554gto.parse(charSequence, FROM);
}
public static boolean isLeap(long j) {
return (3 & j) == 0 && (j % 100 != 0 || j % 400 == 0);
}
private gsF(int i) {
this.year = i;
}
@Override // o.gtK
public final boolean isSupported(InterfaceC15537gtP interfaceC15537gtP) {
return interfaceC15537gtP instanceof EnumC15534gtD ? interfaceC15537gtP == EnumC15534gtD.YEAR || interfaceC15537gtP == EnumC15534gtD.YEAR_OF_ERA || interfaceC15537gtP == EnumC15534gtD.ERA : interfaceC15537gtP != null && interfaceC15537gtP.isSupportedBy(this);
}
@Override // o.InterfaceC15536gtL
public final boolean isSupported(InterfaceC15539gtV interfaceC15539gtV) {
return interfaceC15539gtV instanceof gtH ? interfaceC15539gtV == gtH.YEARS || interfaceC15539gtV == gtH.DECADES || interfaceC15539gtV == gtH.CENTURIES || interfaceC15539gtV == gtH.MILLENNIA || interfaceC15539gtV == gtH.ERAS : interfaceC15539gtV != null && interfaceC15539gtV.isSupportedBy(this);
}
@Override // o.gtE, o.gtK
public final gtT range(InterfaceC15537gtP interfaceC15537gtP) {
if (interfaceC15537gtP == EnumC15534gtD.YEAR_OF_ERA) {
return gtT.of(1L, this.year <= 0 ? 1000000000L : 999999999L);
}
return super.range(interfaceC15537gtP);
}
@Override // o.gtE, o.gtK
public final int get(InterfaceC15537gtP interfaceC15537gtP) {
return range(interfaceC15537gtP).checkValidIntValue(getLong(interfaceC15537gtP), interfaceC15537gtP);
}
@Override // o.gtK
public final long getLong(InterfaceC15537gtP interfaceC15537gtP) {
if (interfaceC15537gtP instanceof EnumC15534gtD) {
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoField[((EnumC15534gtD) interfaceC15537gtP).ordinal()];
if (i == 1) {
int i2 = this.year;
if (i2 <= 0) {
i2 = 1 - i2;
}
return i2;
}
if (i == 2) {
return this.year;
}
if (i == 3) {
return this.year <= 0 ? 0 : 1;
}
throw new UnsupportedTemporalTypeException("Unsupported field: ".concat(String.valueOf(interfaceC15537gtP)));
}
return interfaceC15537gtP.getFrom(this);
}
public final boolean isLeap() {
return isLeap(this.year);
}
public final boolean isValidMonthDay(C15529gsy c15529gsy) {
return c15529gsy != null && c15529gsy.isValidYear(this.year);
}
public final int length() {
return isLeap() ? 366 : 365;
}
@Override // o.InterfaceC15536gtL
public final gsF with(gtJ gtj) {
return (gsF) gtj.adjustInto(this);
}
@Override // o.InterfaceC15536gtL
public final gsF with(InterfaceC15537gtP interfaceC15537gtP, long j) {
if (interfaceC15537gtP instanceof EnumC15534gtD) {
EnumC15534gtD enumC15534gtD = (EnumC15534gtD) interfaceC15537gtP;
enumC15534gtD.checkValidValue(j);
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoField[enumC15534gtD.ordinal()];
if (i == 1) {
if (this.year <= 0) {
j = 1 - j;
}
return of((int) j);
}
if (i == 2) {
return of((int) j);
}
if (i == 3) {
return getLong(EnumC15534gtD.ERA) == j ? this : of(1 - this.year);
}
throw new UnsupportedTemporalTypeException("Unsupported field: ".concat(String.valueOf(interfaceC15537gtP)));
}
return (gsF) interfaceC15537gtP.adjustInto(this, j);
}
@Override // o.InterfaceC15536gtL
public final gsF plus(gtN gtn) {
return (gsF) gtn.addTo(this);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.gsF$2, reason: invalid class name */
/* loaded from: classes6.dex */
public static /* synthetic */ class AnonymousClass2 {
static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoField;
static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoUnit;
static {
int[] iArr = new int[gtH.values().length];
$SwitchMap$org$threeten$bp$temporal$ChronoUnit = iArr;
try {
iArr[gtH.YEARS.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.DECADES.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.CENTURIES.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.MILLENNIA.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.ERAS.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
int[] iArr2 = new int[EnumC15534gtD.values().length];
$SwitchMap$org$threeten$bp$temporal$ChronoField = iArr2;
try {
iArr2[EnumC15534gtD.YEAR_OF_ERA.ordinal()] = 1;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.YEAR.ordinal()] = 2;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.ERA.ordinal()] = 3;
} catch (NoSuchFieldError unused8) {
}
}
}
@Override // o.InterfaceC15536gtL
public final gsF plus(long j, InterfaceC15539gtV interfaceC15539gtV) {
if (interfaceC15539gtV instanceof gtH) {
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoUnit[((gtH) interfaceC15539gtV).ordinal()];
if (i == 1) {
return plusYears(j);
}
if (i == 2) {
return plusYears(gtG.safeMultiply(j, 10));
}
if (i == 3) {
return plusYears(gtG.safeMultiply(j, 100));
}
if (i == 4) {
return plusYears(gtG.safeMultiply(j, 1000));
}
if (i == 5) {
return with((InterfaceC15537gtP) EnumC15534gtD.ERA, gtG.safeAdd(getLong(EnumC15534gtD.ERA), j));
}
throw new UnsupportedTemporalTypeException("Unsupported unit: ".concat(String.valueOf(interfaceC15539gtV)));
}
return (gsF) interfaceC15539gtV.addTo(this, j);
}
public final gsF plusYears(long j) {
return j == 0 ? this : of(EnumC15534gtD.YEAR.checkValidIntValue(this.year + j));
}
@Override // o.InterfaceC15536gtL
public final gsF minus(gtN gtn) {
return (gsF) gtn.subtractFrom(this);
}
@Override // o.InterfaceC15536gtL
public final gsF minus(long j, InterfaceC15539gtV interfaceC15539gtV) {
return j == Long.MIN_VALUE ? plus(Long.MAX_VALUE, interfaceC15539gtV).plus(1L, interfaceC15539gtV) : plus(-j, interfaceC15539gtV);
}
public final gsF minusYears(long j) {
return j == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1L) : plusYears(-j);
}
@Override // o.gtE, o.gtK
public final <R> R query(gtQ<R> gtq) {
if (gtq == gtM.chronology()) {
return (R) gsV.INSTANCE;
}
if (gtq == gtM.precision()) {
return (R) gtH.YEARS;
}
if (gtq == gtM.localDate() || gtq == gtM.localTime() || gtq == gtM.zone() || gtq == gtM.zoneId() || gtq == gtM.offset()) {
return null;
}
return (R) super.query(gtq);
}
@Override // o.gtJ
public final InterfaceC15536gtL adjustInto(InterfaceC15536gtL interfaceC15536gtL) {
if (!gsR.from(interfaceC15536gtL).equals(gsV.INSTANCE)) {
throw new DateTimeException("Adjustment only supported on ISO date-time");
}
return interfaceC15536gtL.with(EnumC15534gtD.YEAR, this.year);
}
@Override // o.InterfaceC15536gtL
public final long until(InterfaceC15536gtL interfaceC15536gtL, InterfaceC15539gtV interfaceC15539gtV) {
gsF from = from(interfaceC15536gtL);
if (interfaceC15539gtV instanceof gtH) {
long j = from.year - this.year;
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoUnit[((gtH) interfaceC15539gtV).ordinal()];
if (i == 1) {
return j;
}
if (i == 2) {
return j / 10;
}
if (i == 3) {
return j / 100;
}
if (i == 4) {
return j / 1000;
}
if (i == 5) {
return from.getLong(EnumC15534gtD.ERA) - getLong(EnumC15534gtD.ERA);
}
throw new UnsupportedTemporalTypeException("Unsupported unit: ".concat(String.valueOf(interfaceC15539gtV)));
}
return interfaceC15539gtV.between(this, from);
}
public final C15520gsp atDay(int i) {
return C15520gsp.ofYearDay(this.year, i);
}
public final gsG atMonth(EnumC15528gsx enumC15528gsx) {
return gsG.of(this.year, enumC15528gsx);
}
public final gsG atMonth(int i) {
return gsG.of(this.year, i);
}
public final C15520gsp atMonthDay(C15529gsy c15529gsy) {
return c15529gsy.atYear(this.year);
}
@Override // java.lang.Comparable
public final int compareTo(gsF gsf) {
return this.year - gsf.year;
}
public final boolean isAfter(gsF gsf) {
return this.year > gsf.year;
}
public final boolean isBefore(gsF gsf) {
return this.year < gsf.year;
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
return (obj instanceof gsF) && this.year == ((gsF) obj).year;
}
public final String toString() {
return Integer.toString(this.year);
}
public final String format(C15554gto c15554gto) {
gtG.requireNonNull(c15554gto, "formatter");
return c15554gto.format(this);
}
private Object writeReplace() {
return new C15501gsD((byte) 67, this);
}
private Object readResolve() throws ObjectStreamException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void writeExternal(DataOutput dataOutput) throws IOException {
dataOutput.writeInt(this.year);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static gsF readExternal(DataInput dataInput) throws IOException {
return of(dataInput.readInt());
}
public final int hashCode() {
return this.year;
}
public final int getValue() {
return this.year;
}
}