米游社.apk(点击下载) / t.java


package f00;

import f00.n;
import java.util.Objects;
import javax.annotation.Nullable;
import sy.b0;
import sy.c0;
import sy.e0;
import sy.f0;
import sy.u;

/* compiled from: Response */
public final class t<T> {

    /* renamed from: a  reason: collision with root package name */
    public final e0 f58407a;
    @Nullable

    /* renamed from: b  reason: collision with root package name */
    public final T f58408b;
    @Nullable

    /* renamed from: c  reason: collision with root package name */
    public final f0 f58409c;

    public t(e0 e0Var, @Nullable T t10, @Nullable f0 f0Var) {
        this.f58407a = e0Var;
        this.f58408b = t10;
        this.f58409c = f0Var;
    }

    public static <T> t<T> c(int i10, f0 f0Var) {
        Objects.requireNonNull(f0Var, "body == null");
        if (i10 >= 400) {
            return d(f0Var, new e0.a().b(new n.c(f0Var.contentType(), f0Var.contentLength())).g(i10).y("Response.error()").B(b0.HTTP_1_1).E(new c0.a().B("http://localhost/").b()).c());
        }
        throw new IllegalArgumentException("code < 400: " + i10);
    }

    public static <T> t<T> d(f0 f0Var, e0 e0Var) {
        Objects.requireNonNull(f0Var, "body == null");
        Objects.requireNonNull(e0Var, "rawResponse == null");
        if (!e0Var.k0()) {
            return new t<>(e0Var, null, f0Var);
        }
        throw new IllegalArgumentException("rawResponse should not be successful response");
    }

    public static <T> t<T> j(int i10, @Nullable T t10) {
        if (i10 >= 200 && i10 < 300) {
            return m(t10, new e0.a().g(i10).y("Response.success()").B(b0.HTTP_1_1).E(new c0.a().B("http://localhost/").b()).c());
        }
        throw new IllegalArgumentException("code < 200 or >= 300: " + i10);
    }

    public static <T> t<T> k(@Nullable T t10) {
        return m(t10, new e0.a().g(200).y("OK").B(b0.HTTP_1_1).E(new c0.a().B("http://localhost/").b()).c());
    }

    public static <T> t<T> l(@Nullable T t10, u uVar) {
        Objects.requireNonNull(uVar, "headers == null");
        return m(t10, new e0.a().g(200).y("OK").B(b0.HTTP_1_1).w(uVar).E(new c0.a().B("http://localhost/").b()).c());
    }

    public static <T> t<T> m(@Nullable T t10, e0 e0Var) {
        Objects.requireNonNull(e0Var, "rawResponse == null");
        if (e0Var.k0()) {
            return new t<>(e0Var, t10, null);
        }
        throw new IllegalArgumentException("rawResponse must be successful response");
    }

    @Nullable
    public T a() {
        return this.f58408b;
    }

    public int b() {
        return this.f58407a.Q();
    }

    @Nullable
    public f0 e() {
        return this.f58409c;
    }

    public u f() {
        return this.f58407a.e0();
    }

    public boolean g() {
        return this.f58407a.k0();
    }

    public String h() {
        return this.f58407a.s0();
    }

    public e0 i() {
        return this.f58407a;
    }

    public String toString() {
        return this.f58407a.toString();
    }
}