302 lines
10 KiB
Java
302 lines
10 KiB
Java
|
package o;
|
||
|
|
||
|
import java.io.Serializable;
|
||
|
|
||
|
/* renamed from: o.gsj, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public abstract class AbstractC15514gsj {
|
||
|
public abstract AbstractC15502gsH getZone();
|
||
|
|
||
|
public abstract C15523gss instant();
|
||
|
|
||
|
public abstract AbstractC15514gsj withZone(AbstractC15502gsH abstractC15502gsH);
|
||
|
|
||
|
public static AbstractC15514gsj systemUTC() {
|
||
|
return new IeS(gsI.UTC);
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj systemDefaultZone() {
|
||
|
return new IeS(AbstractC15502gsH.systemDefault());
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj system(AbstractC15502gsH abstractC15502gsH) {
|
||
|
gtG.requireNonNull(abstractC15502gsH, "zone");
|
||
|
return new IeS(abstractC15502gsH);
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj tickSeconds(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return new Sts(system(abstractC15502gsH), 1000000000L);
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj tickMinutes(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return new Sts(system(abstractC15502gsH), 60000000000L);
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj tick(AbstractC15514gsj abstractC15514gsj, C15519gso c15519gso) {
|
||
|
gtG.requireNonNull(abstractC15514gsj, "baseClock");
|
||
|
gtG.requireNonNull(c15519gso, "tickDuration");
|
||
|
if (c15519gso.isNegative()) {
|
||
|
throw new IllegalArgumentException("Tick duration must not be negative");
|
||
|
}
|
||
|
long nanos = c15519gso.toNanos();
|
||
|
if (nanos % 1000000 == 0 || 1000000000 % nanos == 0) {
|
||
|
return nanos <= 1 ? abstractC15514gsj : new Sts(abstractC15514gsj, nanos);
|
||
|
}
|
||
|
throw new IllegalArgumentException("Invalid tick duration");
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj fixed(C15523gss c15523gss, AbstractC15502gsH abstractC15502gsH) {
|
||
|
gtG.requireNonNull(c15523gss, "fixedInstant");
|
||
|
gtG.requireNonNull(abstractC15502gsH, "zone");
|
||
|
return new RVV(c15523gss, abstractC15502gsH);
|
||
|
}
|
||
|
|
||
|
public static AbstractC15514gsj offset(AbstractC15514gsj abstractC15514gsj, C15519gso c15519gso) {
|
||
|
gtG.requireNonNull(abstractC15514gsj, "baseClock");
|
||
|
gtG.requireNonNull(c15519gso, "offsetDuration");
|
||
|
return c15519gso.equals(C15519gso.ZERO) ? abstractC15514gsj : new HBt(abstractC15514gsj, c15519gso);
|
||
|
}
|
||
|
|
||
|
protected AbstractC15514gsj() {
|
||
|
}
|
||
|
|
||
|
public long millis() {
|
||
|
return instant().toEpochMilli();
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
return super.equals(obj);
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
return super.hashCode();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* renamed from: o.gsj$IeS */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static final class IeS extends AbstractC15514gsj implements Serializable {
|
||
|
private static final long serialVersionUID = 6740630888130243051L;
|
||
|
private final AbstractC15502gsH zone;
|
||
|
|
||
|
IeS(AbstractC15502gsH abstractC15502gsH) {
|
||
|
this.zone = abstractC15502gsH;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15514gsj withZone(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return abstractC15502gsH.equals(this.zone) ? this : new IeS(abstractC15502gsH);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final long millis() {
|
||
|
return System.currentTimeMillis();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final C15523gss instant() {
|
||
|
return C15523gss.ofEpochMilli(millis());
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (obj instanceof IeS) {
|
||
|
return this.zone.equals(((IeS) obj).zone);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final int hashCode() {
|
||
|
return this.zone.hashCode() + 1;
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder("SystemClock[");
|
||
|
sb.append(this.zone);
|
||
|
sb.append("]");
|
||
|
return sb.toString();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15502gsH getZone() {
|
||
|
return this.zone;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.gsj$RVV */
|
||
|
/* loaded from: classes6.dex */
|
||
|
static final class RVV extends AbstractC15514gsj implements Serializable {
|
||
|
private static final long serialVersionUID = 7430389292664866958L;
|
||
|
private final C15523gss instant;
|
||
|
private final AbstractC15502gsH zone;
|
||
|
|
||
|
RVV(C15523gss c15523gss, AbstractC15502gsH abstractC15502gsH) {
|
||
|
this.instant = c15523gss;
|
||
|
this.zone = abstractC15502gsH;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15514gsj withZone(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return abstractC15502gsH.equals(this.zone) ? this : new RVV(this.instant, abstractC15502gsH);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final long millis() {
|
||
|
return this.instant.toEpochMilli();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (!(obj instanceof RVV)) {
|
||
|
return false;
|
||
|
}
|
||
|
RVV rvv = (RVV) obj;
|
||
|
return this.instant.equals(rvv.instant) && this.zone.equals(rvv.zone);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final int hashCode() {
|
||
|
return this.instant.hashCode() ^ this.zone.hashCode();
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder("FixedClock[");
|
||
|
sb.append(this.instant);
|
||
|
sb.append(",");
|
||
|
sb.append(this.zone);
|
||
|
sb.append("]");
|
||
|
return sb.toString();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final C15523gss instant() {
|
||
|
return this.instant;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15502gsH getZone() {
|
||
|
return this.zone;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.gsj$HBt */
|
||
|
/* loaded from: classes6.dex */
|
||
|
static final class HBt extends AbstractC15514gsj implements Serializable {
|
||
|
private static final long serialVersionUID = 2007484719125426256L;
|
||
|
private final AbstractC15514gsj baseClock;
|
||
|
private final C15519gso offset;
|
||
|
|
||
|
HBt(AbstractC15514gsj abstractC15514gsj, C15519gso c15519gso) {
|
||
|
this.baseClock = abstractC15514gsj;
|
||
|
this.offset = c15519gso;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15502gsH getZone() {
|
||
|
return this.baseClock.getZone();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15514gsj withZone(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return abstractC15502gsH.equals(this.baseClock.getZone()) ? this : new HBt(this.baseClock.withZone(abstractC15502gsH), this.offset);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final long millis() {
|
||
|
return gtG.safeAdd(this.baseClock.millis(), this.offset.toMillis());
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final C15523gss instant() {
|
||
|
return this.baseClock.instant().plus((gtN) this.offset);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (!(obj instanceof HBt)) {
|
||
|
return false;
|
||
|
}
|
||
|
HBt hBt = (HBt) obj;
|
||
|
return this.baseClock.equals(hBt.baseClock) && this.offset.equals(hBt.offset);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final int hashCode() {
|
||
|
return this.baseClock.hashCode() ^ this.offset.hashCode();
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder("OffsetClock[");
|
||
|
sb.append(this.baseClock);
|
||
|
sb.append(",");
|
||
|
sb.append(this.offset);
|
||
|
sb.append("]");
|
||
|
return sb.toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.gsj$Sts */
|
||
|
/* loaded from: classes6.dex */
|
||
|
static final class Sts extends AbstractC15514gsj implements Serializable {
|
||
|
private static final long serialVersionUID = 6504659149906368850L;
|
||
|
private final AbstractC15514gsj baseClock;
|
||
|
private final long tickNanos;
|
||
|
|
||
|
Sts(AbstractC15514gsj abstractC15514gsj, long j) {
|
||
|
this.baseClock = abstractC15514gsj;
|
||
|
this.tickNanos = j;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15502gsH getZone() {
|
||
|
return this.baseClock.getZone();
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final AbstractC15514gsj withZone(AbstractC15502gsH abstractC15502gsH) {
|
||
|
return abstractC15502gsH.equals(this.baseClock.getZone()) ? this : new Sts(this.baseClock.withZone(abstractC15502gsH), this.tickNanos);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final long millis() {
|
||
|
long millis = this.baseClock.millis();
|
||
|
return millis - gtG.floorMod(millis, this.tickNanos / 1000000);
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final C15523gss instant() {
|
||
|
if (this.tickNanos % 1000000 == 0) {
|
||
|
long millis = this.baseClock.millis();
|
||
|
return C15523gss.ofEpochMilli(millis - gtG.floorMod(millis, this.tickNanos / 1000000));
|
||
|
}
|
||
|
return this.baseClock.instant().minusNanos(gtG.floorMod(r0.getNano(), this.tickNanos));
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (!(obj instanceof Sts)) {
|
||
|
return false;
|
||
|
}
|
||
|
Sts sts = (Sts) obj;
|
||
|
return this.baseClock.equals(sts.baseClock) && this.tickNanos == sts.tickNanos;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15514gsj
|
||
|
public final int hashCode() {
|
||
|
int hashCode = this.baseClock.hashCode();
|
||
|
long j = this.tickNanos;
|
||
|
return hashCode ^ ((int) (j ^ (j >>> 32)));
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
StringBuilder sb = new StringBuilder("TickClock[");
|
||
|
sb.append(this.baseClock);
|
||
|
sb.append(",");
|
||
|
sb.append(C15519gso.ofNanos(this.tickNanos));
|
||
|
sb.append("]");
|
||
|
return sb.toString();
|
||
|
}
|
||
|
}
|
||
|
}
|