jimu-decompiled/sources/okhttp3/Challenge.java
2025-05-13 19:24:51 +02:00

65 lines
1.7 KiB
Java

package okhttp3;
import java.nio.charset.Charset;
import okhttp3.internal.Util;
/* loaded from: classes2.dex */
public final class Challenge {
private final Charset charset;
private final String realm;
private final String scheme;
public Challenge(String str, String str2) {
this(str, str2, Util.ISO_8859_1);
}
public Charset charset() {
return this.charset;
}
public boolean equals(Object obj) {
if (obj instanceof Challenge) {
Challenge challenge = (Challenge) obj;
if (challenge.scheme.equals(this.scheme) && challenge.realm.equals(this.realm) && challenge.charset.equals(this.charset)) {
return true;
}
}
return false;
}
public int hashCode() {
return ((((899 + this.realm.hashCode()) * 31) + this.scheme.hashCode()) * 31) + this.charset.hashCode();
}
public String realm() {
return this.realm;
}
public String scheme() {
return this.scheme;
}
public String toString() {
return this.scheme + " realm=\"" + this.realm + "\" charset=\"" + this.charset + "\"";
}
public Challenge withCharset(Charset charset) {
return new Challenge(this.scheme, this.realm, charset);
}
private Challenge(String str, String str2, Charset charset) {
if (str == null) {
throw new NullPointerException("scheme == null");
}
if (str2 == null) {
throw new NullPointerException("realm == null");
}
if (charset == null) {
throw new NullPointerException("charset == null");
}
this.scheme = str;
this.realm = str2;
this.charset = charset;
}
}