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

47 lines
1.1 KiB
Java

package okhttp3;
import java.io.IOException;
/* loaded from: classes2.dex */
public enum Protocol {
HTTP_1_0("http/1.0"),
HTTP_1_1("http/1.1"),
SPDY_3("spdy/3.1"),
HTTP_2("h2"),
H2_PRIOR_KNOWLEDGE("h2_prior_knowledge"),
QUIC("quic");
private final String protocol;
Protocol(String str) {
this.protocol = str;
}
public static Protocol get(String str) throws IOException {
if (str.equals(HTTP_1_0.protocol)) {
return HTTP_1_0;
}
if (str.equals(HTTP_1_1.protocol)) {
return HTTP_1_1;
}
if (str.equals(H2_PRIOR_KNOWLEDGE.protocol)) {
return H2_PRIOR_KNOWLEDGE;
}
if (str.equals(HTTP_2.protocol)) {
return HTTP_2;
}
if (str.equals(SPDY_3.protocol)) {
return SPDY_3;
}
if (str.equals(QUIC.protocol)) {
return QUIC;
}
throw new IOException("Unexpected protocol: " + str);
}
@Override // java.lang.Enum
public String toString() {
return this.protocol;
}
}