161 lines
5.9 KiB
Java
161 lines
5.9 KiB
Java
package o;
|
|
|
|
import java.util.Comparator;
|
|
import o.gsJ;
|
|
import org.threeten.bp.DateTimeException;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class gsO<D extends gsJ> extends AbstractC15535gtF implements gtJ, Comparable<gsO<?>> {
|
|
private static final Comparator<gsO<?>> DATE_TIME_COMPARATOR = new Comparator<gsO<?>>() { // from class: o.gsO.2
|
|
/* JADX WARN: Type inference failed for: r0v0, types: [o.gsJ] */
|
|
/* JADX WARN: Type inference failed for: r2v0, types: [o.gsJ] */
|
|
@Override // java.util.Comparator
|
|
public final int compare(gsO<?> gso, gsO<?> gso2) {
|
|
int compareLongs = gtG.compareLongs(gso.toLocalDate().toEpochDay(), gso2.toLocalDate().toEpochDay());
|
|
return compareLongs == 0 ? gtG.compareLongs(gso.toLocalTime().toNanoOfDay(), gso2.toLocalTime().toNanoOfDay()) : compareLongs;
|
|
}
|
|
};
|
|
|
|
/* renamed from: atZone */
|
|
public abstract gsS<D> atZone2(AbstractC15502gsH abstractC15502gsH);
|
|
|
|
@Override // o.InterfaceC15536gtL
|
|
public abstract gsO<D> plus(long j, InterfaceC15539gtV interfaceC15539gtV);
|
|
|
|
public abstract D toLocalDate();
|
|
|
|
public abstract C15521gsq toLocalTime();
|
|
|
|
@Override // o.InterfaceC15536gtL
|
|
public abstract gsO<D> with(InterfaceC15537gtP interfaceC15537gtP, long j);
|
|
|
|
public static gsO<?> from(gtK gtk) {
|
|
gtG.requireNonNull(gtk, "temporal");
|
|
if (gtk instanceof gsO) {
|
|
return (gsO) gtk;
|
|
}
|
|
gsR gsr = (gsR) gtk.query(gtM.chronology());
|
|
if (gsr == null) {
|
|
StringBuilder sb = new StringBuilder("No Chronology found to create ChronoLocalDateTime: ");
|
|
sb.append(gtk.getClass());
|
|
throw new DateTimeException(sb.toString());
|
|
}
|
|
return gsr.localDateTime(gtk);
|
|
}
|
|
|
|
public gsR getChronology() {
|
|
return toLocalDate().getChronology();
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsO<D> with(gtJ gtj) {
|
|
return toLocalDate().getChronology().ensureChronoLocalDateTime(super.with(gtj));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsO<D> plus(gtN gtn) {
|
|
return toLocalDate().getChronology().ensureChronoLocalDateTime(super.plus(gtn));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsO<D> minus(gtN gtn) {
|
|
return toLocalDate().getChronology().ensureChronoLocalDateTime(super.minus(gtn));
|
|
}
|
|
|
|
@Override // o.AbstractC15535gtF, o.InterfaceC15536gtL
|
|
public gsO<D> minus(long j, InterfaceC15539gtV interfaceC15539gtV) {
|
|
return toLocalDate().getChronology().ensureChronoLocalDateTime(super.minus(j, interfaceC15539gtV));
|
|
}
|
|
|
|
@Override // o.gtE, o.gtK
|
|
public <R> R query(gtQ<R> gtq) {
|
|
if (gtq == gtM.chronology()) {
|
|
return (R) getChronology();
|
|
}
|
|
if (gtq == gtM.precision()) {
|
|
return (R) gtH.NANOS;
|
|
}
|
|
if (gtq == gtM.localDate()) {
|
|
return (R) C15520gsp.ofEpochDay(toLocalDate().toEpochDay());
|
|
}
|
|
if (gtq == gtM.localTime()) {
|
|
return (R) toLocalTime();
|
|
}
|
|
if (gtq == gtM.zone() || gtq == gtM.zoneId() || gtq == gtM.offset()) {
|
|
return null;
|
|
}
|
|
return (R) super.query(gtq);
|
|
}
|
|
|
|
@Override // o.gtJ
|
|
public InterfaceC15536gtL adjustInto(InterfaceC15536gtL interfaceC15536gtL) {
|
|
return interfaceC15536gtL.with(EnumC15534gtD.EPOCH_DAY, toLocalDate().toEpochDay()).with(EnumC15534gtD.NANO_OF_DAY, toLocalTime().toNanoOfDay());
|
|
}
|
|
|
|
public String format(C15554gto c15554gto) {
|
|
gtG.requireNonNull(c15554gto, "formatter");
|
|
return c15554gto.format(this);
|
|
}
|
|
|
|
public C15523gss toInstant(gsI gsi) {
|
|
return C15523gss.ofEpochSecond(toEpochSecond(gsi), toLocalTime().getNano());
|
|
}
|
|
|
|
public long toEpochSecond(gsI gsi) {
|
|
gtG.requireNonNull(gsi, "offset");
|
|
return ((toLocalDate().toEpochDay() * 86400) + toLocalTime().toSecondOfDay()) - gsi.getTotalSeconds();
|
|
}
|
|
|
|
@Override // java.lang.Comparable
|
|
public int compareTo(gsO<?> gso) {
|
|
int compareTo = toLocalDate().compareTo(gso.toLocalDate());
|
|
if (compareTo != 0) {
|
|
return compareTo;
|
|
}
|
|
int compareTo2 = toLocalTime().compareTo2(gso.toLocalTime());
|
|
return compareTo2 == 0 ? getChronology().compareTo(gso.getChronology()) : compareTo2;
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r2v0, types: [o.gsJ] */
|
|
public boolean isAfter(gsO<?> gso) {
|
|
long epochDay = toLocalDate().toEpochDay();
|
|
long epochDay2 = gso.toLocalDate().toEpochDay();
|
|
return epochDay > epochDay2 || (epochDay == epochDay2 && toLocalTime().toNanoOfDay() > gso.toLocalTime().toNanoOfDay());
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r2v0, types: [o.gsJ] */
|
|
public boolean isBefore(gsO<?> gso) {
|
|
long epochDay = toLocalDate().toEpochDay();
|
|
long epochDay2 = gso.toLocalDate().toEpochDay();
|
|
return epochDay < epochDay2 || (epochDay == epochDay2 && toLocalTime().toNanoOfDay() < gso.toLocalTime().toNanoOfDay());
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r5v2, types: [o.gsJ] */
|
|
public boolean isEqual(gsO<?> gso) {
|
|
return toLocalTime().toNanoOfDay() == gso.toLocalTime().toNanoOfDay() && toLocalDate().toEpochDay() == gso.toLocalDate().toEpochDay();
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
return (obj instanceof gsO) && compareTo((gsO<?>) obj) == 0;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return toLocalDate().hashCode() ^ toLocalTime().hashCode();
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(toLocalDate().toString());
|
|
sb.append('T');
|
|
sb.append(toLocalTime().toString());
|
|
return sb.toString();
|
|
}
|
|
|
|
public static Comparator<gsO<?>> timeLineOrder() {
|
|
return DATE_TIME_COMPARATOR;
|
|
}
|
|
}
|