package h5; import h5.a0; import java.io.Closeable; /* loaded from: classes2.dex */ public final class i0 implements Closeable { /* renamed from: a, reason: collision with root package name */ final h0 f10117a; /* renamed from: b, reason: collision with root package name */ final j0 f10118b; /* renamed from: c, reason: collision with root package name */ final int f10119c; /* renamed from: d, reason: collision with root package name */ final String f10120d; /* renamed from: e, reason: collision with root package name */ final z f10121e; /* renamed from: f, reason: collision with root package name */ final a0 f10122f; /* renamed from: g, reason: collision with root package name */ final l0 f10123g; /* renamed from: h, reason: collision with root package name */ final i0 f10124h; /* renamed from: i, reason: collision with root package name */ final i0 f10125i; /* renamed from: j, reason: collision with root package name */ final i0 f10126j; /* renamed from: k, reason: collision with root package name */ final long f10127k; /* renamed from: l, reason: collision with root package name */ final long f10128l; /* renamed from: m, reason: collision with root package name */ private volatile h f10129m; public static class a { /* renamed from: a, reason: collision with root package name */ h0 f10130a; /* renamed from: b, reason: collision with root package name */ j0 f10131b; /* renamed from: c, reason: collision with root package name */ int f10132c; /* renamed from: d, reason: collision with root package name */ String f10133d; /* renamed from: e, reason: collision with root package name */ z f10134e; /* renamed from: f, reason: collision with root package name */ a0.a f10135f; /* renamed from: g, reason: collision with root package name */ l0 f10136g; /* renamed from: h, reason: collision with root package name */ i0 f10137h; /* renamed from: i, reason: collision with root package name */ i0 f10138i; /* renamed from: j, reason: collision with root package name */ i0 f10139j; /* renamed from: k, reason: collision with root package name */ long f10140k; /* renamed from: l, reason: collision with root package name */ long f10141l; public a() { this.f10132c = -1; this.f10135f = new a0.a(); } private void a(i0 i0Var) { if (i0Var.f10123g != null) { throw new IllegalArgumentException("priorMobonResponse.body != null"); } } private void b(String str, i0 i0Var) { if (i0Var.f10123g != null) { throw new IllegalArgumentException(str + ".body != null"); } if (i0Var.f10124h != null) { throw new IllegalArgumentException(str + ".networkMobonResponse != null"); } if (i0Var.f10125i != null) { throw new IllegalArgumentException(str + ".cacheMobonResponse != null"); } if (i0Var.f10126j == null) { return; } throw new IllegalArgumentException(str + ".priorMobonResponse != null"); } public a c(String str, String str2) { this.f10135f.c(str, str2); return this; } public a d(l0 l0Var) { this.f10136g = l0Var; return this; } public i0 e() { if (this.f10130a == null) { throw new IllegalStateException("mobonRequest == null"); } if (this.f10131b == null) { throw new IllegalStateException("protocol == null"); } if (this.f10132c >= 0) { if (this.f10133d != null) { return new i0(this); } throw new IllegalStateException("message == null"); } throw new IllegalStateException("code < 0: " + this.f10132c); } public a f(i0 i0Var) { if (i0Var != null) { b("cacheMobonResponse", i0Var); } this.f10138i = i0Var; return this; } public a g(int i10) { this.f10132c = i10; return this; } public a h(z zVar) { this.f10134e = zVar; return this; } public a i(a0 a0Var) { this.f10135f = a0Var.d(); return this; } public a j(String str) { this.f10133d = str; return this; } public a k(i0 i0Var) { if (i0Var != null) { b("networkMobonResponse", i0Var); } this.f10137h = i0Var; return this; } public a l(i0 i0Var) { if (i0Var != null) { a(i0Var); } this.f10139j = i0Var; return this; } public a m(j0 j0Var) { this.f10131b = j0Var; return this; } public a n(long j10) { this.f10141l = j10; return this; } public a o(h0 h0Var) { this.f10130a = h0Var; return this; } public a p(long j10) { this.f10140k = j10; return this; } a(i0 i0Var) { this.f10132c = -1; this.f10130a = i0Var.f10117a; this.f10131b = i0Var.f10118b; this.f10132c = i0Var.f10119c; this.f10133d = i0Var.f10120d; this.f10134e = i0Var.f10121e; this.f10135f = i0Var.f10122f.d(); this.f10136g = i0Var.f10123g; this.f10137h = i0Var.f10124h; this.f10138i = i0Var.f10125i; this.f10139j = i0Var.f10126j; this.f10140k = i0Var.f10127k; this.f10141l = i0Var.f10128l; } } i0(a aVar) { this.f10117a = aVar.f10130a; this.f10118b = aVar.f10131b; this.f10119c = aVar.f10132c; this.f10120d = aVar.f10133d; this.f10121e = aVar.f10134e; this.f10122f = aVar.f10135f.e(); this.f10123g = aVar.f10136g; this.f10124h = aVar.f10137h; this.f10125i = aVar.f10138i; this.f10126j = aVar.f10139j; this.f10127k = aVar.f10140k; this.f10128l = aVar.f10141l; } public int G() { return this.f10119c; } public z I() { return this.f10121e; } public String O(String str) { return P(str, null); } public String P(String str, String str2) { String b10 = this.f10122f.b(str); return b10 != null ? b10 : str2; } public a0 R() { return this.f10122f; } public boolean S() { int i10 = this.f10119c; return i10 >= 200 && i10 < 300; } public String Y() { return this.f10120d; } public a a0() { return new a(this); } public l0 c() { return this.f10123g; } @Override // java.io.Closeable, java.lang.AutoCloseable public void close() { l0 l0Var = this.f10123g; if (l0Var == null) { throw new IllegalStateException("response is not eligible for a body and must not be closed"); } l0Var.close(); } public i0 d0() { return this.f10126j; } public long f0() { return this.f10128l; } public h0 j0() { return this.f10117a; } public long m0() { return this.f10127k; } public String toString() { return "MobonResponse{protocol=" + this.f10118b + ", code=" + this.f10119c + ", message=" + this.f10120d + ", url=" + this.f10117a.h() + '}'; } public h z() { h hVar = this.f10129m; if (hVar != null) { return hVar; } h l10 = h.l(this.f10122f); this.f10129m = l10; return l10; } }