package o; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Locale; import org.threeten.bp.DateTimeException; import org.threeten.bp.temporal.UnsupportedTemporalTypeException; /* renamed from: o.gtg, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public enum EnumC15546gtg implements gsY { BEFORE_ROC, ROC; public static EnumC15546gtg of(int i) { if (i == 0) { return BEFORE_ROC; } if (i == 1) { return ROC; } throw new DateTimeException("Invalid era: ".concat(String.valueOf(i))); } @Override // o.gsY public final int getValue() { return ordinal(); } @Override // o.gtK public final boolean isSupported(InterfaceC15537gtP interfaceC15537gtP) { return interfaceC15537gtP instanceof EnumC15534gtD ? interfaceC15537gtP == EnumC15534gtD.ERA : interfaceC15537gtP != null && interfaceC15537gtP.isSupportedBy(this); } @Override // o.gtK public final gtT range(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP == EnumC15534gtD.ERA) { return interfaceC15537gtP.range(); } if (interfaceC15537gtP instanceof EnumC15534gtD) { throw new UnsupportedTemporalTypeException("Unsupported field: ".concat(String.valueOf(interfaceC15537gtP))); } return interfaceC15537gtP.rangeRefinedBy(this); } @Override // o.gtK public final int get(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP == EnumC15534gtD.ERA) { return getValue(); } return range(interfaceC15537gtP).checkValidIntValue(getLong(interfaceC15537gtP), interfaceC15537gtP); } @Override // o.gtK public final long getLong(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP == EnumC15534gtD.ERA) { return getValue(); } if (interfaceC15537gtP instanceof EnumC15534gtD) { throw new UnsupportedTemporalTypeException("Unsupported field: ".concat(String.valueOf(interfaceC15537gtP))); } return interfaceC15537gtP.getFrom(this); } @Override // o.gtJ public final InterfaceC15536gtL adjustInto(InterfaceC15536gtL interfaceC15536gtL) { return interfaceC15536gtL.with(EnumC15534gtD.ERA, getValue()); } @Override // o.gtK public final R query(gtQ gtq) { if (gtq == gtM.precision()) { return (R) gtH.ERAS; } if (gtq == gtM.chronology() || gtq == gtM.zone() || gtq == gtM.zoneId() || gtq == gtM.offset() || gtq == gtM.localDate() || gtq == gtM.localTime()) { return null; } return gtq.queryFrom(this); } @Override // o.gsY public final String getDisplayName(EnumC15532gtB enumC15532gtB, Locale locale) { return new C15553gtn().appendText(EnumC15534gtD.ERA, enumC15532gtB).toFormatter(locale).format(this); } private Object writeReplace() { return new C15548gti((byte) 6, this); } /* JADX INFO: Access modifiers changed from: package-private */ public final void writeExternal(DataOutput dataOutput) throws IOException { dataOutput.writeByte(getValue()); } /* JADX INFO: Access modifiers changed from: package-private */ public static EnumC15546gtg readExternal(DataInput dataInput) throws IOException { return of(dataInput.readByte()); } }