discord-jadx/app/src/main/java/i0/g.java

147 lines
4.5 KiB
Java
Raw Normal View History

2021-08-03 07:33:18 +00:00
package i0;
2021-11-02 06:38:17 +00:00
import i0.e;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.concurrent.CompletableFuture;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import retrofit2.HttpException;
import retrofit2.Response;
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public final class g extends e.a {
public static final e.a a = new g();
2021-08-03 07:33:18 +00:00
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public static final class a<R> implements e<R, CompletableFuture<R>> {
public final Type a;
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
/* renamed from: i0.g$a$a reason: collision with other inner class name */
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2022-03-21 18:52:30 +00:00
public class C0390a implements f<R> {
2021-11-02 06:38:17 +00:00
public final CompletableFuture<R> a;
2022-03-21 18:52:30 +00:00
public C0390a(a aVar, CompletableFuture<R> completableFuture) {
2021-11-02 06:38:17 +00:00
this.a = completableFuture;
}
@Override // i0.f
public void a(d<R> dVar, Throwable th) {
this.a.completeExceptionally(th);
}
@Override // i0.f
public void b(d<R> dVar, Response<R> response) {
if (response.a()) {
2022-03-28 08:10:50 +00:00
this.a.complete(response.f3817b);
2021-11-02 06:38:17 +00:00
} else {
this.a.completeExceptionally(new HttpException(response));
}
}
}
public a(Type type) {
this.a = type;
}
@Override // i0.e
public Type a() {
return this.a;
}
@Override // i0.e
public Object b(d dVar) {
b bVar = new b(dVar);
2022-03-21 18:52:30 +00:00
dVar.C(new C0390a(this, bVar));
2021-11-02 06:38:17 +00:00
return bVar;
}
}
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public static final class b<T> extends CompletableFuture<T> {
2021-12-02 18:53:44 +00:00
public final d<?> j;
2021-11-02 06:38:17 +00:00
public b(d<?> dVar) {
2021-12-02 18:53:44 +00:00
this.j = dVar;
2021-11-02 06:38:17 +00:00
}
@Override // java.util.concurrent.CompletableFuture, java.util.concurrent.Future
public boolean cancel(boolean z2) {
if (z2) {
2021-12-02 18:53:44 +00:00
this.j.cancel();
2021-11-02 06:38:17 +00:00
}
return super.cancel(z2);
}
}
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public static final class c<R> implements e<R, CompletableFuture<Response<R>>> {
public final Type a;
2022-03-07 09:34:54 +00:00
/* compiled from: CompletableFutureCallAdapterFactory.java */
2021-11-02 06:38:17 +00:00
@IgnoreJRERequirement
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public class a implements f<R> {
public final CompletableFuture<Response<R>> a;
public a(c cVar, CompletableFuture<Response<R>> completableFuture) {
this.a = completableFuture;
}
@Override // i0.f
public void a(d<R> dVar, Throwable th) {
this.a.completeExceptionally(th);
}
@Override // i0.f
public void b(d<R> dVar, Response<R> response) {
this.a.complete(response);
}
}
public c(Type type) {
this.a = type;
}
@Override // i0.e
public Type a() {
return this.a;
}
@Override // i0.e
public Object b(d dVar) {
b bVar = new b(dVar);
2021-11-05 06:48:17 +00:00
dVar.C(new a(this, bVar));
2021-11-02 06:38:17 +00:00
return bVar;
}
}
@Override // i0.e.a
public e<?, ?> a(Type type, Annotation[] annotationArr, y yVar) {
if (c0.f(type) != CompletableFuture.class) {
return null;
}
if (type instanceof ParameterizedType) {
Type e = c0.e(0, (ParameterizedType) type);
if (c0.f(e) != Response.class) {
return new a(e);
}
if (e instanceof ParameterizedType) {
return new c(c0.e(0, (ParameterizedType) e));
}
throw new IllegalStateException("Response must be parameterized as Response<Foo> or Response<? extends Foo>");
}
throw new IllegalStateException("CompletableFuture return type must be parameterized as CompletableFuture<Foo> or CompletableFuture<? extends Foo>");
}
2021-08-03 07:33:18 +00:00
}