package uq;

import java.io.IOException;

/* loaded from: classes3.dex */
public enum a0 {
    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"),
    HTTP_3("h3");

    public static final a Companion = new a(null);
    private final String protocol;

    /* loaded from: classes3.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }

        public final a0 a(String protocol) {
            boolean P;
            kotlin.jvm.internal.t.g(protocol, "protocol");
            a0 a0Var = a0.HTTP_1_0;
            if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                a0Var = a0.HTTP_1_1;
                if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                    a0Var = a0.H2_PRIOR_KNOWLEDGE;
                    if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                        a0Var = a0.HTTP_2;
                        if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                            a0Var = a0.SPDY_3;
                            if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                                a0Var = a0.QUIC;
                                if (!kotlin.jvm.internal.t.b(protocol, a0Var.protocol)) {
                                    a0Var = a0.HTTP_3;
                                    P = kotlin.text.y.P(protocol, a0Var.protocol, false, 2, null);
                                    if (!P) {
                                        throw new IOException("Unexpected protocol: " + protocol);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return a0Var;
        }
    }

    a0(String str) {
        this.protocol = str;
    }

    public static final a0 get(String str) throws IOException {
        return Companion.a(str);
    }

    @Override // java.lang.Enum
    public String toString() {
        return this.protocol;
    }
}
