discord-jadx/app/src/main/java/f0/y.java

83 lines
1.9 KiB
Java
Raw Normal View History

2021-06-27 20:44:35 +00:00
package f0;
2021-10-19 23:48:27 +00:00
import c0.z.d.m;
2021-06-27 20:44:35 +00:00
import java.io.IOException;
2021-10-19 23:48:27 +00:00
import java.io.InterruptedIOException;
import java.util.concurrent.TimeUnit;
/* compiled from: Timeout.kt */
public class y {
public static final y a = new a();
public boolean b;
/* renamed from: c reason: collision with root package name */
2021-11-03 22:42:40 +00:00
public long f3036c;
2021-10-19 23:48:27 +00:00
public long d;
/* compiled from: Timeout.kt */
public static final class a extends y {
@Override // f0.y
public y d(long j) {
return this;
2021-06-27 20:44:35 +00:00
}
2021-10-19 23:48:27 +00:00
@Override // f0.y
public void f() {
}
@Override // f0.y
public y g(long j, TimeUnit timeUnit) {
m.checkParameterIsNotNull(timeUnit, "unit");
return this;
2021-06-27 20:44:35 +00:00
}
}
2021-10-19 23:48:27 +00:00
public y a() {
this.b = false;
return this;
}
public y b() {
this.d = 0;
return this;
}
public long c() {
if (this.b) {
2021-11-03 22:42:40 +00:00
return this.f3036c;
2021-10-19 23:48:27 +00:00
}
throw new IllegalStateException("No deadline".toString());
2021-06-27 20:44:35 +00:00
}
2021-10-19 23:48:27 +00:00
public y d(long j) {
this.b = true;
2021-11-03 22:42:40 +00:00
this.f3036c = j;
2021-10-19 23:48:27 +00:00
return this;
}
public boolean e() {
return this.b;
}
public void f() throws IOException {
if (Thread.interrupted()) {
Thread.currentThread().interrupt();
throw new InterruptedIOException("interrupted");
2021-11-03 22:42:40 +00:00
} else if (this.b && this.f3036c - System.nanoTime() <= 0) {
2021-10-19 23:48:27 +00:00
throw new InterruptedIOException("deadline reached");
}
}
public y g(long j, TimeUnit timeUnit) {
m.checkParameterIsNotNull(timeUnit, "unit");
if (j >= 0) {
this.d = timeUnit.toNanos(j);
return this;
}
throw new IllegalArgumentException(c.d.b.a.a.q("timeout < 0: ", j).toString());
2021-06-27 20:44:35 +00:00
}
2021-10-19 23:48:27 +00:00
public long h() {
return this.d;
2021-06-27 20:44:35 +00:00
}
}