Rabbit-R1/switch port/java/sources/okhttp3/Response.java
2024-05-21 17:08:36 -04:00

590 lines
32 KiB
Java

package okhttp3;
import com.google.common.net.HttpHeaders;
import io.sentry.SentryBaseEvent;
import io.sentry.protocol.OperatingSystem;
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.Headers;
import okhttp3.internal.connection.Exchange;
import okio.Buffer;
import okio.BufferedSource;
import okio.Source;
/* compiled from: Response.kt */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000p\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u000b\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u000b\u0018\u00002\u00020\u0001:\u0001FB{\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\b\u0010\n\u001a\u0004\u0018\u00010\u000b\u0012\u0006\u0010\f\u001a\u00020\r\u0012\b\u0010\u000e\u001a\u0004\u0018\u00010\u000f\u0012\b\u0010\u0010\u001a\u0004\u0018\u00010\u0000\u0012\b\u0010\u0011\u001a\u0004\u0018\u00010\u0000\u0012\b\u0010\u0012\u001a\u0004\u0018\u00010\u0000\u0012\u0006\u0010\u0013\u001a\u00020\u0014\u0012\u0006\u0010\u0015\u001a\u00020\u0014\u0012\b\u0010\u0016\u001a\u0004\u0018\u00010\u0017¢\u0006\u0002\u0010\u0018J\u000f\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0007¢\u0006\u0002\b+J\r\u0010\u001a\u001a\u00020\u001bH\u0007¢\u0006\u0002\b,J\u000f\u0010\u0011\u001a\u0004\u0018\u00010\u0000H\u0007¢\u0006\u0002\b-J\f\u0010.\u001a\b\u0012\u0004\u0012\u0002000/J\b\u00101\u001a\u000202H\u0016J\r\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b3J\u000f\u0010\n\u001a\u0004\u0018\u00010\u000bH\u0007¢\u0006\u0002\b4J\u001e\u00105\u001a\u0004\u0018\u00010\u00072\u0006\u00106\u001a\u00020\u00072\n\b\u0002\u00107\u001a\u0004\u0018\u00010\u0007H\u0007J\r\u0010\f\u001a\u00020\rH\u0007¢\u0006\u0002\b8J\u0014\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00070/2\u0006\u00106\u001a\u00020\u0007J\r\u0010\u0006\u001a\u00020\u0007H\u0007¢\u0006\u0002\b9J\u000f\u0010\u0010\u001a\u0004\u0018\u00010\u0000H\u0007¢\u0006\u0002\b:J\u0006\u0010;\u001a\u00020<J\u000e\u0010=\u001a\u00020\u000f2\u0006\u0010>\u001a\u00020\u0014J\u000f\u0010\u0012\u001a\u0004\u0018\u00010\u0000H\u0007¢\u0006\u0002\b?J\r\u0010\u0004\u001a\u00020\u0005H\u0007¢\u0006\u0002\b@J\r\u0010\u0015\u001a\u00020\u0014H\u0007¢\u0006\u0002\bAJ\r\u0010\u0002\u001a\u00020\u0003H\u0007¢\u0006\u0002\bBJ\r\u0010\u0013\u001a\u00020\u0014H\u0007¢\u0006\u0002\bCJ\b\u0010D\u001a\u00020\u0007H\u0016J\u0006\u0010E\u001a\u00020\rR\u0015\u0010\u000e\u001a\u0004\u0018\u00010\u000f8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u0019R\u0011\u0010\u001a\u001a\u00020\u001b8G¢\u0006\u0006\u001a\u0004\b\u001a\u0010\u001cR\u0015\u0010\u0011\u001a\u0004\u0018\u00010\u00008\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u001dR\u0013\u0010\b\u001a\u00020\t8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u001eR\u0018\u0010\u0016\u001a\u0004\u0018\u00010\u00178\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0016\u0010\u001fR\u0015\u0010\n\u001a\u0004\u0018\u00010\u000b8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010 R\u0013\u0010\f\u001a\u00020\r8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010!R\u0011\u0010\"\u001a\u00020#8F¢\u0006\u0006\u001a\u0004\b\"\u0010$R\u0011\u0010%\u001a\u00020#8F¢\u0006\u0006\u001a\u0004\b%\u0010$R\u0010\u0010&\u001a\u0004\u0018\u00010\u001bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0013\u0010\u0006\u001a\u00020\u00078\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010'R\u0015\u0010\u0010\u001a\u0004\u0018\u00010\u00008\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u001dR\u0015\u0010\u0012\u001a\u0004\u0018\u00010\u00008\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0012\u0010\u001dR\u0013\u0010\u0004\u001a\u00020\u00058\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0004\u0010(R\u0013\u0010\u0015\u001a\u00020\u00148\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010)R\u0013\u0010\u0002\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010*R\u0013\u0010\u0013\u001a\u00020\u00148\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010)¨\u0006G"}, d2 = {"Lokhttp3/Response;", "Ljava/io/Closeable;", SentryBaseEvent.JsonKeys.REQUEST, "Lokhttp3/Request;", "protocol", "Lokhttp3/Protocol;", "message", "", "code", "", "handshake", "Lokhttp3/Handshake;", "headers", "Lokhttp3/Headers;", "body", "Lokhttp3/ResponseBody;", "networkResponse", "cacheResponse", "priorResponse", "sentRequestAtMillis", "", "receivedResponseAtMillis", "exchange", "Lokhttp3/internal/connection/Exchange;", "(Lokhttp3/Request;Lokhttp3/Protocol;Ljava/lang/String;ILokhttp3/Handshake;Lokhttp3/Headers;Lokhttp3/ResponseBody;Lokhttp3/Response;Lokhttp3/Response;Lokhttp3/Response;JJLokhttp3/internal/connection/Exchange;)V", "()Lokhttp3/ResponseBody;", "cacheControl", "Lokhttp3/CacheControl;", "()Lokhttp3/CacheControl;", "()Lokhttp3/Response;", "()I", "()Lokhttp3/internal/connection/Exchange;", "()Lokhttp3/Handshake;", "()Lokhttp3/Headers;", "isRedirect", "", "()Z", "isSuccessful", "lazyCacheControl", "()Ljava/lang/String;", "()Lokhttp3/Protocol;", "()J", "()Lokhttp3/Request;", "-deprecated_body", "-deprecated_cacheControl", "-deprecated_cacheResponse", "challenges", "", "Lokhttp3/Challenge;", "close", "", "-deprecated_code", "-deprecated_handshake", "header", "name", "defaultValue", "-deprecated_headers", "-deprecated_message", "-deprecated_networkResponse", "newBuilder", "Lokhttp3/Response$Builder;", "peekBody", "byteCount", "-deprecated_priorResponse", "-deprecated_protocol", "-deprecated_receivedResponseAtMillis", "-deprecated_request", "-deprecated_sentRequestAtMillis", "toString", "trailers", "Builder", "okhttp"}, k = 1, mv = {1, 4, 0})
/* loaded from: classes3.dex */
public final class Response implements Closeable {
private final ResponseBody body;
private final Response cacheResponse;
private final int code;
private final Exchange exchange;
private final Handshake handshake;
private final Headers headers;
private CacheControl lazyCacheControl;
private final String message;
private final Response networkResponse;
private final Response priorResponse;
private final Protocol protocol;
private final long receivedResponseAtMillis;
private final Request request;
private final long sentRequestAtMillis;
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "body", imports = {}))
/* renamed from: -deprecated_body, reason: not valid java name and from getter */
public final ResponseBody getBody() {
return this.body;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "cacheResponse", imports = {}))
/* renamed from: -deprecated_cacheResponse, reason: not valid java name and from getter */
public final Response getCacheResponse() {
return this.cacheResponse;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "code", imports = {}))
/* renamed from: -deprecated_code, reason: not valid java name and from getter */
public final int getCode() {
return this.code;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "handshake", imports = {}))
/* renamed from: -deprecated_handshake, reason: not valid java name and from getter */
public final Handshake getHandshake() {
return this.handshake;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "headers", imports = {}))
/* renamed from: -deprecated_headers, reason: not valid java name and from getter */
public final Headers getHeaders() {
return this.headers;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "message", imports = {}))
/* renamed from: -deprecated_message, reason: not valid java name and from getter */
public final String getMessage() {
return this.message;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "networkResponse", imports = {}))
/* renamed from: -deprecated_networkResponse, reason: not valid java name and from getter */
public final Response getNetworkResponse() {
return this.networkResponse;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "priorResponse", imports = {}))
/* renamed from: -deprecated_priorResponse, reason: not valid java name and from getter */
public final Response getPriorResponse() {
return this.priorResponse;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "protocol", imports = {}))
/* renamed from: -deprecated_protocol, reason: not valid java name and from getter */
public final Protocol getProtocol() {
return this.protocol;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "receivedResponseAtMillis", imports = {}))
/* renamed from: -deprecated_receivedResponseAtMillis, reason: not valid java name and from getter */
public final long getReceivedResponseAtMillis() {
return this.receivedResponseAtMillis;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = SentryBaseEvent.JsonKeys.REQUEST, imports = {}))
/* renamed from: -deprecated_request, reason: not valid java name and from getter */
public final Request getRequest() {
return this.request;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "sentRequestAtMillis", imports = {}))
/* renamed from: -deprecated_sentRequestAtMillis, reason: not valid java name and from getter */
public final long getSentRequestAtMillis() {
return this.sentRequestAtMillis;
}
public final ResponseBody body() {
return this.body;
}
public final Response cacheResponse() {
return this.cacheResponse;
}
public final int code() {
return this.code;
}
/* renamed from: exchange, reason: from getter */
public final Exchange getExchange() {
return this.exchange;
}
public final Handshake handshake() {
return this.handshake;
}
public final String header(String str) {
return header$default(this, str, null, 2, null);
}
public final Headers headers() {
return this.headers;
}
public final boolean isRedirect() {
int i = this.code;
if (i != 307 && i != 308) {
switch (i) {
case 300:
case 301:
case 302:
case 303:
break;
default:
return false;
}
}
return true;
}
public final boolean isSuccessful() {
int i = this.code;
return 200 <= i && 299 >= i;
}
public final String message() {
return this.message;
}
public final Response networkResponse() {
return this.networkResponse;
}
public final Response priorResponse() {
return this.priorResponse;
}
public final Protocol protocol() {
return this.protocol;
}
public final long receivedResponseAtMillis() {
return this.receivedResponseAtMillis;
}
public final Request request() {
return this.request;
}
public final long sentRequestAtMillis() {
return this.sentRequestAtMillis;
}
public Response(Request request, Protocol protocol, String message, int i, Handshake handshake, Headers headers, ResponseBody responseBody, Response response, Response response2, Response response3, long j, long j2, Exchange exchange) {
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(protocol, "protocol");
Intrinsics.checkNotNullParameter(message, "message");
Intrinsics.checkNotNullParameter(headers, "headers");
this.request = request;
this.protocol = protocol;
this.message = message;
this.code = i;
this.handshake = handshake;
this.headers = headers;
this.body = responseBody;
this.networkResponse = response;
this.cacheResponse = response2;
this.priorResponse = response3;
this.sentRequestAtMillis = j;
this.receivedResponseAtMillis = j2;
this.exchange = exchange;
}
public final List<String> headers(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return this.headers.values(name);
}
public static /* synthetic */ String header$default(Response response, String str, String str2, int i, Object obj) {
if ((i & 2) != 0) {
str2 = null;
}
return response.header(str, str2);
}
public final String header(String name, String defaultValue) {
Intrinsics.checkNotNullParameter(name, "name");
String str = this.headers.get(name);
return str != null ? str : defaultValue;
}
public final Headers trailers() throws IOException {
Exchange exchange = this.exchange;
if (exchange != null) {
return exchange.trailers();
}
throw new IllegalStateException("trailers not available".toString());
}
public final ResponseBody peekBody(long byteCount) throws IOException {
ResponseBody responseBody = this.body;
Intrinsics.checkNotNull(responseBody);
BufferedSource peek = responseBody.source().peek();
Buffer buffer = new Buffer();
peek.request(byteCount);
buffer.write((Source) peek, Math.min(byteCount, peek.getBuffer().size()));
return ResponseBody.INSTANCE.create(buffer, this.body.contentType(), buffer.size());
}
public final Builder newBuilder() {
return new Builder(this);
}
public final List<Challenge> challenges() {
String str;
Headers headers = this.headers;
int i = this.code;
if (i == 401) {
str = HttpHeaders.WWW_AUTHENTICATE;
} else {
if (i != 407) {
return CollectionsKt.emptyList();
}
str = HttpHeaders.PROXY_AUTHENTICATE;
}
return okhttp3.internal.http.HttpHeaders.parseChallenges(headers, str);
}
public final CacheControl cacheControl() {
CacheControl cacheControl = this.lazyCacheControl;
if (cacheControl != null) {
return cacheControl;
}
CacheControl parse = CacheControl.INSTANCE.parse(this.headers);
this.lazyCacheControl = parse;
return parse;
}
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "cacheControl", imports = {}))
/* renamed from: -deprecated_cacheControl, reason: not valid java name */
public final CacheControl m7388deprecated_cacheControl() {
return cacheControl();
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
ResponseBody responseBody = this.body;
if (responseBody == null) {
throw new IllegalStateException("response is not eligible for a body and must not be closed".toString());
}
responseBody.close();
}
public String toString() {
return "Response{protocol=" + this.protocol + ", code=" + this.code + ", message=" + this.message + ", url=" + this.request.url() + '}';
}
/* compiled from: Response.kt */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000l\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0016\u0018\u00002\u00020\u0001B\u0007\b\u0016¢\u0006\u0002\u0010\u0002B\u000f\b\u0010\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0018\u0010I\u001a\u00020\u00002\u0006\u0010J\u001a\u00020)2\u0006\u0010K\u001a\u00020)H\u0016J\u0012\u0010\u0006\u001a\u00020\u00002\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0016J\b\u0010L\u001a\u00020\u0004H\u0016J\u0012\u0010\f\u001a\u00020\u00002\b\u0010\f\u001a\u0004\u0018\u00010\u0004H\u0016J\u0012\u0010M\u001a\u00020N2\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004H\u0002J\u001a\u0010O\u001a\u00020N2\u0006\u0010J\u001a\u00020)2\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004H\u0002J\u0010\u0010\u0010\u001a\u00020\u00002\u0006\u0010\u0010\u001a\u00020\u0011H\u0016J\u0012\u0010\u001c\u001a\u00020\u00002\b\u0010\u001c\u001a\u0004\u0018\u00010\u001dH\u0016J\u0018\u0010P\u001a\u00020\u00002\u0006\u0010J\u001a\u00020)2\u0006\u0010K\u001a\u00020)H\u0016J\u0010\u0010\"\u001a\u00020\u00002\u0006\u0010\"\u001a\u00020QH\u0016J\u0015\u0010R\u001a\u00020N2\u0006\u0010S\u001a\u00020\u0017H\u0000¢\u0006\u0002\bTJ\u0010\u0010(\u001a\u00020\u00002\u0006\u0010(\u001a\u00020)H\u0016J\u0012\u0010.\u001a\u00020\u00002\b\u0010.\u001a\u0004\u0018\u00010\u0004H\u0016J\u0012\u00101\u001a\u00020\u00002\b\u00101\u001a\u0004\u0018\u00010\u0004H\u0016J\u0010\u00104\u001a\u00020\u00002\u0006\u00104\u001a\u000205H\u0016J\u0010\u0010:\u001a\u00020\u00002\u0006\u0010:\u001a\u00020;H\u0016J\u0010\u0010U\u001a\u00020\u00002\u0006\u0010J\u001a\u00020)H\u0016J\u0010\u0010@\u001a\u00020\u00002\u0006\u0010@\u001a\u00020AH\u0016J\u0010\u0010F\u001a\u00020\u00002\u0006\u0010F\u001a\u00020;H\u0016R\u001c\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u001c\u0010\f\u001a\u0004\u0018\u00010\u0004X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0005R\u001a\u0010\u0010\u001a\u00020\u0011X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015R\u001c\u0010\u0016\u001a\u0004\u0018\u00010\u0017X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0018\u0010\u0019\"\u0004\b\u001a\u0010\u001bR\u001c\u0010\u001c\u001a\u0004\u0018\u00010\u001dX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001e\u0010\u001f\"\u0004\b \u0010!R\u001a\u0010\"\u001a\u00020#X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b$\u0010%\"\u0004\b&\u0010'R\u001c\u0010(\u001a\u0004\u0018\u00010)X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b*\u0010+\"\u0004\b,\u0010-R\u001c\u0010.\u001a\u0004\u0018\u00010\u0004X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b/\u0010\u000e\"\u0004\b0\u0010\u0005R\u001c\u00101\u001a\u0004\u0018\u00010\u0004X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b2\u0010\u000e\"\u0004\b3\u0010\u0005R\u001c\u00104\u001a\u0004\u0018\u000105X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b6\u00107\"\u0004\b8\u00109R\u001a\u0010:\u001a\u00020;X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b<\u0010=\"\u0004\b>\u0010?R\u001c\u0010@\u001a\u0004\u0018\u00010AX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bB\u0010C\"\u0004\bD\u0010ER\u001a\u0010F\u001a\u00020;X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bG\u0010=\"\u0004\bH\u0010?¨\u0006V"}, d2 = {"Lokhttp3/Response$Builder;", "", "()V", io.sentry.protocol.Response.TYPE, "Lokhttp3/Response;", "(Lokhttp3/Response;)V", "body", "Lokhttp3/ResponseBody;", "getBody$okhttp", "()Lokhttp3/ResponseBody;", "setBody$okhttp", "(Lokhttp3/ResponseBody;)V", "cacheResponse", "getCacheResponse$okhttp", "()Lokhttp3/Response;", "setCacheResponse$okhttp", "code", "", "getCode$okhttp", "()I", "setCode$okhttp", "(I)V", "exchange", "Lokhttp3/internal/connection/Exchange;", "getExchange$okhttp", "()Lokhttp3/internal/connection/Exchange;", "setExchange$okhttp", "(Lokhttp3/internal/connection/Exchange;)V", "handshake", "Lokhttp3/Handshake;", "getHandshake$okhttp", "()Lokhttp3/Handshake;", "setHandshake$okhttp", "(Lokhttp3/Handshake;)V", "headers", "Lokhttp3/Headers$Builder;", "getHeaders$okhttp", "()Lokhttp3/Headers$Builder;", "setHeaders$okhttp", "(Lokhttp3/Headers$Builder;)V", "message", "", "getMessage$okhttp", "()Ljava/lang/String;", "setMessage$okhttp", "(Ljava/lang/String;)V", "networkResponse", "getNetworkResponse$okhttp", "setNetworkResponse$okhttp", "priorResponse", "getPriorResponse$okhttp", "setPriorResponse$okhttp", "protocol", "Lokhttp3/Protocol;", "getProtocol$okhttp", "()Lokhttp3/Protocol;", "setProtocol$okhttp", "(Lokhttp3/Protocol;)V", "receivedResponseAtMillis", "", "getReceivedResponseAtMillis$okhttp", "()J", "setReceivedResponseAtMillis$okhttp", "(J)V", SentryBaseEvent.JsonKeys.REQUEST, "Lokhttp3/Request;", "getRequest$okhttp", "()Lokhttp3/Request;", "setRequest$okhttp", "(Lokhttp3/Request;)V", "sentRequestAtMillis", "getSentRequestAtMillis$okhttp", "setSentRequestAtMillis$okhttp", "addHeader", "name", "value", OperatingSystem.JsonKeys.BUILD, "checkPriorResponse", "", "checkSupportResponse", "header", "Lokhttp3/Headers;", "initExchange", "deferredTrailers", "initExchange$okhttp", "removeHeader", "okhttp"}, k = 1, mv = {1, 4, 0})
/* loaded from: classes3.dex */
public static class Builder {
private ResponseBody body;
private Response cacheResponse;
private int code;
private Exchange exchange;
private Handshake handshake;
private Headers.Builder headers;
private String message;
private Response networkResponse;
private Response priorResponse;
private Protocol protocol;
private long receivedResponseAtMillis;
private Request request;
private long sentRequestAtMillis;
/* renamed from: getBody$okhttp, reason: from getter */
public final ResponseBody getBody() {
return this.body;
}
/* renamed from: getCacheResponse$okhttp, reason: from getter */
public final Response getCacheResponse() {
return this.cacheResponse;
}
/* renamed from: getCode$okhttp, reason: from getter */
public final int getCode() {
return this.code;
}
/* renamed from: getExchange$okhttp, reason: from getter */
public final Exchange getExchange() {
return this.exchange;
}
/* renamed from: getHandshake$okhttp, reason: from getter */
public final Handshake getHandshake() {
return this.handshake;
}
/* renamed from: getHeaders$okhttp, reason: from getter */
public final Headers.Builder getHeaders() {
return this.headers;
}
/* renamed from: getMessage$okhttp, reason: from getter */
public final String getMessage() {
return this.message;
}
/* renamed from: getNetworkResponse$okhttp, reason: from getter */
public final Response getNetworkResponse() {
return this.networkResponse;
}
/* renamed from: getPriorResponse$okhttp, reason: from getter */
public final Response getPriorResponse() {
return this.priorResponse;
}
/* renamed from: getProtocol$okhttp, reason: from getter */
public final Protocol getProtocol() {
return this.protocol;
}
/* renamed from: getReceivedResponseAtMillis$okhttp, reason: from getter */
public final long getReceivedResponseAtMillis() {
return this.receivedResponseAtMillis;
}
/* renamed from: getRequest$okhttp, reason: from getter */
public final Request getRequest() {
return this.request;
}
/* renamed from: getSentRequestAtMillis$okhttp, reason: from getter */
public final long getSentRequestAtMillis() {
return this.sentRequestAtMillis;
}
public final void initExchange$okhttp(Exchange deferredTrailers) {
Intrinsics.checkNotNullParameter(deferredTrailers, "deferredTrailers");
this.exchange = deferredTrailers;
}
public final void setBody$okhttp(ResponseBody responseBody) {
this.body = responseBody;
}
public final void setCacheResponse$okhttp(Response response) {
this.cacheResponse = response;
}
public final void setCode$okhttp(int i) {
this.code = i;
}
public final void setExchange$okhttp(Exchange exchange) {
this.exchange = exchange;
}
public final void setHandshake$okhttp(Handshake handshake) {
this.handshake = handshake;
}
public final void setHeaders$okhttp(Headers.Builder builder) {
Intrinsics.checkNotNullParameter(builder, "<set-?>");
this.headers = builder;
}
public final void setMessage$okhttp(String str) {
this.message = str;
}
public final void setNetworkResponse$okhttp(Response response) {
this.networkResponse = response;
}
public final void setPriorResponse$okhttp(Response response) {
this.priorResponse = response;
}
public final void setProtocol$okhttp(Protocol protocol) {
this.protocol = protocol;
}
public final void setReceivedResponseAtMillis$okhttp(long j) {
this.receivedResponseAtMillis = j;
}
public final void setRequest$okhttp(Request request) {
this.request = request;
}
public final void setSentRequestAtMillis$okhttp(long j) {
this.sentRequestAtMillis = j;
}
public Builder() {
this.code = -1;
this.headers = new Headers.Builder();
}
public Builder(Response response) {
Intrinsics.checkNotNullParameter(response, "response");
this.code = -1;
this.request = response.request();
this.protocol = response.protocol();
this.code = response.code();
this.message = response.message();
this.handshake = response.handshake();
this.headers = response.headers().newBuilder();
this.body = response.body();
this.networkResponse = response.networkResponse();
this.cacheResponse = response.cacheResponse();
this.priorResponse = response.priorResponse();
this.sentRequestAtMillis = response.sentRequestAtMillis();
this.receivedResponseAtMillis = response.receivedResponseAtMillis();
this.exchange = response.getExchange();
}
public Builder request(Request request) {
Intrinsics.checkNotNullParameter(request, "request");
this.request = request;
return this;
}
public Builder protocol(Protocol protocol) {
Intrinsics.checkNotNullParameter(protocol, "protocol");
this.protocol = protocol;
return this;
}
public Builder code(int code) {
this.code = code;
return this;
}
public Builder message(String message) {
Intrinsics.checkNotNullParameter(message, "message");
this.message = message;
return this;
}
public Builder handshake(Handshake handshake) {
this.handshake = handshake;
return this;
}
public Builder header(String name, String value) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(value, "value");
this.headers.set(name, value);
return this;
}
public Builder addHeader(String name, String value) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(value, "value");
this.headers.add(name, value);
return this;
}
public Builder removeHeader(String name) {
Intrinsics.checkNotNullParameter(name, "name");
this.headers.removeAll(name);
return this;
}
public Builder headers(Headers headers) {
Intrinsics.checkNotNullParameter(headers, "headers");
this.headers = headers.newBuilder();
return this;
}
public Builder body(ResponseBody body) {
this.body = body;
return this;
}
public Builder networkResponse(Response networkResponse) {
checkSupportResponse("networkResponse", networkResponse);
this.networkResponse = networkResponse;
return this;
}
public Builder cacheResponse(Response cacheResponse) {
checkSupportResponse("cacheResponse", cacheResponse);
this.cacheResponse = cacheResponse;
return this;
}
private final void checkSupportResponse(String name, Response response) {
if (response != null) {
if (!(response.body() == null)) {
throw new IllegalArgumentException((name + ".body != null").toString());
}
if (!(response.networkResponse() == null)) {
throw new IllegalArgumentException((name + ".networkResponse != null").toString());
}
if (!(response.cacheResponse() == null)) {
throw new IllegalArgumentException((name + ".cacheResponse != null").toString());
}
if (!(response.priorResponse() == null)) {
throw new IllegalArgumentException((name + ".priorResponse != null").toString());
}
}
}
public Builder priorResponse(Response priorResponse) {
checkPriorResponse(priorResponse);
this.priorResponse = priorResponse;
return this;
}
private final void checkPriorResponse(Response response) {
if (response != null) {
if (!(response.body() == null)) {
throw new IllegalArgumentException("priorResponse.body != null".toString());
}
}
}
public Builder sentRequestAtMillis(long sentRequestAtMillis) {
this.sentRequestAtMillis = sentRequestAtMillis;
return this;
}
public Builder receivedResponseAtMillis(long receivedResponseAtMillis) {
this.receivedResponseAtMillis = receivedResponseAtMillis;
return this;
}
public Response build() {
int i = this.code;
if (!(i >= 0)) {
throw new IllegalStateException(("code < 0: " + this.code).toString());
}
Request request = this.request;
if (request == null) {
throw new IllegalStateException("request == null".toString());
}
Protocol protocol = this.protocol;
if (protocol == null) {
throw new IllegalStateException("protocol == null".toString());
}
String str = this.message;
if (str != null) {
return new Response(request, protocol, str, i, this.handshake, this.headers.build(), this.body, this.networkResponse, this.cacheResponse, this.priorResponse, this.sentRequestAtMillis, this.receivedResponseAtMillis, this.exchange);
}
throw new IllegalStateException("message == null".toString());
}
}
}