251 lines
9.0 KiB
Java
251 lines
9.0 KiB
Java
package o;
|
|
|
|
import java.util.Comparator;
|
|
import o.gsJ;
|
|
import org.threeten.bp.DateTimeException;
|
|
import org.threeten.bp.temporal.UnsupportedTemporalTypeException;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public abstract class gsS<D extends gsJ> extends AbstractC15535gtF implements Comparable<gsS<?>> {
|
|
private static Comparator<gsS<?>> INSTANT_COMPARATOR = new Comparator<gsS<?>>() { // from class: o.gsS.3
|
|
@Override // java.util.Comparator
|
|
public final int compare(gsS<?> gss, gsS<?> gss2) {
|
|
int compareLongs = gtG.compareLongs(gss.toEpochSecond(), gss2.toEpochSecond());
|
|
return compareLongs == 0 ? gtG.compareLongs(gss.toLocalTime().toNanoOfDay(), gss2.toLocalTime().toNanoOfDay()) : compareLongs;
|
|
}
|
|
};
|
|
|
|
public abstract gsI getOffset();
|
|
|
|
public abstract AbstractC15502gsH getZone();
|
|
|
|
@Override // o.InterfaceC15536gtL
|
|
public abstract gsS<D> plus(long j, InterfaceC15539gtV interfaceC15539gtV);
|
|
|
|
public abstract gsO<D> toLocalDateTime();
|
|
|
|
@Override // o.InterfaceC15536gtL
|
|
public abstract gsS<D> with(InterfaceC15537gtP interfaceC15537gtP, long j);
|
|
|
|
/* renamed from: withEarlierOffsetAtOverlap */
|
|
public abstract gsS<D> withEarlierOffsetAtOverlap2();
|
|
|
|
/* renamed from: withLaterOffsetAtOverlap */
|
|
public abstract gsS<D> withLaterOffsetAtOverlap2();
|
|
|
|
/* renamed from: withZoneSameInstant */
|
|
public abstract gsS<D> withZoneSameInstant2(AbstractC15502gsH abstractC15502gsH);
|
|
|
|
/* renamed from: withZoneSameLocal */
|
|
public abstract gsS<D> withZoneSameLocal2(AbstractC15502gsH abstractC15502gsH);
|
|
|
|
public static gsS<?> from(gtK gtk) {
|
|
gtG.requireNonNull(gtk, "temporal");
|
|
if (gtk instanceof gsS) {
|
|
return (gsS) gtk;
|
|
}
|
|
gsR gsr = (gsR) gtk.query(gtM.chronology());
|
|
if (gsr == null) {
|
|
StringBuilder sb = new StringBuilder("No Chronology found to create ChronoZonedDateTime: ");
|
|
sb.append(gtk.getClass());
|
|
throw new DateTimeException(sb.toString());
|
|
}
|
|
return gsr.zonedDateTime(gtk);
|
|
}
|
|
|
|
@Override // o.gtE, o.gtK
|
|
public gtT range(InterfaceC15537gtP interfaceC15537gtP) {
|
|
if (interfaceC15537gtP instanceof EnumC15534gtD) {
|
|
if (interfaceC15537gtP == EnumC15534gtD.INSTANT_SECONDS || interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS) {
|
|
return interfaceC15537gtP.range();
|
|
}
|
|
return toLocalDateTime().range(interfaceC15537gtP);
|
|
}
|
|
return interfaceC15537gtP.rangeRefinedBy(this);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.gsS$2, reason: invalid class name */
|
|
/* loaded from: classes6.dex */
|
|
public static /* synthetic */ class AnonymousClass2 {
|
|
static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoField;
|
|
|
|
static {
|
|
int[] iArr = new int[EnumC15534gtD.values().length];
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField = iArr;
|
|
try {
|
|
iArr[EnumC15534gtD.INSTANT_SECONDS.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.OFFSET_SECONDS.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // o.gtE, o.gtK
|
|
public int get(InterfaceC15537gtP interfaceC15537gtP) {
|
|
if (interfaceC15537gtP instanceof EnumC15534gtD) {
|
|
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoField[((EnumC15534gtD) interfaceC15537gtP).ordinal()];
|
|
if (i == 1) {
|
|
throw new UnsupportedTemporalTypeException("Field too large for an int: ".concat(String.valueOf(interfaceC15537gtP)));
|
|
}
|
|
if (i == 2) {
|
|
return getOffset().getTotalSeconds();
|
|
}
|
|
return toLocalDateTime().get(interfaceC15537gtP);
|
|
}
|
|
return super.get(interfaceC15537gtP);
|
|
}
|
|
|
|
@Override // o.gtK
|
|
public long getLong(InterfaceC15537gtP interfaceC15537gtP) {
|
|
if (interfaceC15537gtP instanceof EnumC15534gtD) {
|
|
int i = AnonymousClass2.$SwitchMap$org$threeten$bp$temporal$ChronoField[((EnumC15534gtD) interfaceC15537gtP).ordinal()];
|
|
if (i == 1) {
|
|
return toEpochSecond();
|
|
}
|
|
if (i == 2) {
|
|
return getOffset().getTotalSeconds();
|
|
}
|
|
return toLocalDateTime().getLong(interfaceC15537gtP);
|
|
}
|
|
return interfaceC15537gtP.getFrom(this);
|
|
}
|
|
|
|
public D toLocalDate() {
|
|
return toLocalDateTime().toLocalDate();
|
|
}
|
|
|
|
public C15521gsq toLocalTime() {
|
|
return toLocalDateTime().toLocalTime();
|
|
}
|
|
|
|
public gsR getChronology() {
|
|
return toLocalDate().getChronology();
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsS<D> with(gtJ gtj) {
|
|
return toLocalDate().getChronology().ensureChronoZonedDateTime(super.with(gtj));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsS<D> plus(gtN gtn) {
|
|
return toLocalDate().getChronology().ensureChronoZonedDateTime(super.plus(gtn));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsS<D> minus(gtN gtn) {
|
|
return toLocalDate().getChronology().ensureChronoZonedDateTime(super.minus(gtn));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsS<D> minus(long j, InterfaceC15539gtV interfaceC15539gtV) {
|
|
return toLocalDate().getChronology().ensureChronoZonedDateTime(super.minus(j, interfaceC15539gtV));
|
|
}
|
|
|
|
@Override // o.gtE, o.gtK
|
|
public <R> R query(gtQ<R> gtq) {
|
|
if (gtq == gtM.zoneId() || gtq == gtM.zone()) {
|
|
return (R) getZone();
|
|
}
|
|
if (gtq == gtM.chronology()) {
|
|
return (R) toLocalDate().getChronology();
|
|
}
|
|
if (gtq == gtM.precision()) {
|
|
return (R) gtH.NANOS;
|
|
}
|
|
if (gtq == gtM.offset()) {
|
|
return (R) getOffset();
|
|
}
|
|
if (gtq == gtM.localDate()) {
|
|
return (R) C15520gsp.ofEpochDay(toLocalDate().toEpochDay());
|
|
}
|
|
if (gtq == gtM.localTime()) {
|
|
return (R) toLocalTime();
|
|
}
|
|
return (R) super.query(gtq);
|
|
}
|
|
|
|
public String format(C15554gto c15554gto) {
|
|
gtG.requireNonNull(c15554gto, "formatter");
|
|
return c15554gto.format(this);
|
|
}
|
|
|
|
public C15523gss toInstant() {
|
|
return C15523gss.ofEpochSecond(toEpochSecond(), toLocalTime().getNano());
|
|
}
|
|
|
|
public long toEpochSecond() {
|
|
return ((toLocalDate().toEpochDay() * 86400) + toLocalTime().toSecondOfDay()) - getOffset().getTotalSeconds();
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r5v1, types: [o.gsJ] */
|
|
@Override // java.lang.Comparable
|
|
public int compareTo(gsS<?> gss) {
|
|
int compareLongs = gtG.compareLongs(toEpochSecond(), gss.toEpochSecond());
|
|
if (compareLongs != 0) {
|
|
return compareLongs;
|
|
}
|
|
int nano = toLocalTime().getNano() - gss.toLocalTime().getNano();
|
|
if (nano != 0) {
|
|
return nano;
|
|
}
|
|
int compareTo = toLocalDateTime().compareTo(gss.toLocalDateTime());
|
|
if (compareTo != 0) {
|
|
return compareTo;
|
|
}
|
|
int compareTo2 = getZone().getId().compareTo(gss.getZone().getId());
|
|
return compareTo2 == 0 ? toLocalDate().getChronology().compareTo(gss.toLocalDate().getChronology()) : compareTo2;
|
|
}
|
|
|
|
public boolean isAfter(gsS<?> gss) {
|
|
long epochSecond = toEpochSecond();
|
|
long epochSecond2 = gss.toEpochSecond();
|
|
return epochSecond > epochSecond2 || (epochSecond == epochSecond2 && toLocalTime().getNano() > gss.toLocalTime().getNano());
|
|
}
|
|
|
|
public boolean isBefore(gsS<?> gss) {
|
|
long epochSecond = toEpochSecond();
|
|
long epochSecond2 = gss.toEpochSecond();
|
|
return epochSecond < epochSecond2 || (epochSecond == epochSecond2 && toLocalTime().getNano() < gss.toLocalTime().getNano());
|
|
}
|
|
|
|
public boolean isEqual(gsS<?> gss) {
|
|
return toEpochSecond() == gss.toEpochSecond() && toLocalTime().getNano() == gss.toLocalTime().getNano();
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
return (obj instanceof gsS) && compareTo((gsS<?>) obj) == 0;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return (toLocalDateTime().hashCode() ^ getOffset().hashCode()) ^ Integer.rotateLeft(getZone().hashCode(), 3);
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(toLocalDateTime().toString());
|
|
sb.append(getOffset().toString());
|
|
String obj = sb.toString();
|
|
if (getOffset() == getZone()) {
|
|
return obj;
|
|
}
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(obj);
|
|
sb2.append('[');
|
|
sb2.append(getZone().toString());
|
|
sb2.append(']');
|
|
return sb2.toString();
|
|
}
|
|
|
|
public static Comparator<gsS<?>> timeLineOrder() {
|
|
return INSTANT_COMPARATOR;
|
|
}
|
|
}
|