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

85 lines
1.9 KiB
Java
Raw Normal View History

2021-11-08 18:25:28 +00:00
package g0;
import d0.z.d.m;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.concurrent.TimeUnit;
/* compiled from: Timeout.kt */
2022-03-02 20:59:20 +00:00
/* loaded from: classes3.dex */
2021-11-08 18:25:28 +00:00
public class y {
public static final y a = new a();
2021-12-21 23:37:30 +00:00
/* renamed from: b reason: collision with root package name */
2022-03-30 16:43:10 +00:00
public boolean f3677b;
2021-12-21 23:37:30 +00:00
public long c;
2021-11-08 18:25:28 +00:00
public long d;
/* compiled from: Timeout.kt */
2022-03-02 20:59:20 +00:00
/* loaded from: classes3.dex */
2021-11-08 18:25:28 +00:00
public static final class a extends y {
@Override // g0.y
public y d(long j) {
return this;
}
@Override // g0.y
public void f() {
}
@Override // g0.y
public y g(long j, TimeUnit timeUnit) {
m.checkParameterIsNotNull(timeUnit, "unit");
return this;
}
}
public y a() {
2022-03-30 16:43:10 +00:00
this.f3677b = false;
2021-11-08 18:25:28 +00:00
return this;
}
public y b() {
2022-03-02 20:59:20 +00:00
this.d = 0L;
2021-11-08 18:25:28 +00:00
return this;
}
public long c() {
2022-03-30 16:43:10 +00:00
if (this.f3677b) {
2021-12-21 23:37:30 +00:00
return this.c;
2021-11-08 18:25:28 +00:00
}
throw new IllegalStateException("No deadline".toString());
}
public y d(long j) {
2022-03-30 16:43:10 +00:00
this.f3677b = true;
2021-12-21 23:37:30 +00:00
this.c = j;
2021-11-08 18:25:28 +00:00
return this;
}
public boolean e() {
2022-03-30 16:43:10 +00:00
return this.f3677b;
2021-11-08 18:25:28 +00:00
}
public void f() throws IOException {
if (Thread.interrupted()) {
Thread.currentThread().interrupt();
throw new InterruptedIOException("interrupted");
2022-03-30 16:43:10 +00:00
} else if (this.f3677b && this.c - System.nanoTime() <= 0) {
2021-11-08 18:25:28 +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;
}
2021-12-21 23:37:30 +00:00
throw new IllegalArgumentException(b.d.b.a.a.s("timeout < 0: ", j).toString());
2021-11-08 18:25:28 +00:00
}
public long h() {
return this.d;
}
}