package F7;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.LinkedHashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes.dex */
public final class Q {

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public static final Pattern f2641y = Pattern.compile("\\{([a-zA-Z][a-zA-Z0-9_-]*)\\}");

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public static final Pattern f2642z = Pattern.compile("[a-zA-Z][a-zA-Z0-9_-]*");

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final V f2643a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Class f2644b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Method f2645c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Annotation[] f2646d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Annotation[][] f2647e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final Type[] f2648f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f2649g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f2650h;
    public boolean i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f2651j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f2652k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public boolean f2653l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f2654m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public boolean f2655n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public String f2656o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public boolean f2657p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public boolean f2658q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public boolean f2659r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public String f2660s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public k7.o f2661t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public k7.s f2662u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public LinkedHashSet f2663v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public b0[] f2664w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public boolean f2665x;

    public Q(V v7, Class cls, Method method) {
        this.f2643a = v7;
        this.f2644b = cls;
        this.f2645c = method;
        this.f2646d = method.getAnnotations();
        this.f2648f = method.getGenericParameterTypes();
        this.f2647e = method.getParameterAnnotations();
    }

    public static Class a(Class cls) {
        return Boolean.TYPE == cls ? Boolean.class : Byte.TYPE == cls ? Byte.class : Character.TYPE == cls ? Character.class : Double.TYPE == cls ? Double.class : Float.TYPE == cls ? Float.class : Integer.TYPE == cls ? Integer.class : Long.TYPE == cls ? Long.class : Short.TYPE == cls ? Short.class : cls;
    }

    public final void b(String str, String str2, boolean z8) {
        String str3 = this.f2656o;
        Method method = this.f2645c;
        if (str3 != null) {
            throw b0.n(method, null, "Only one HTTP method is allowed. Found: %s and %s.", str3, str);
        }
        this.f2656o = str;
        this.f2657p = z8;
        if (str2.isEmpty()) {
            return;
        }
        int iIndexOf = str2.indexOf(63);
        Pattern pattern = f2641y;
        if (iIndexOf != -1 && iIndexOf < str2.length() - 1) {
            String strSubstring = str2.substring(iIndexOf + 1);
            if (pattern.matcher(strSubstring).find()) {
                throw b0.n(method, null, "URL query string \"%s\" must not have replace block. For dynamic query parameters use @Query.", strSubstring);
            }
        }
        this.f2660s = str2;
        Matcher matcher = pattern.matcher(str2);
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        while (matcher.find()) {
            linkedHashSet.add(matcher.group(1));
        }
        this.f2663v = linkedHashSet;
    }

    public final void c(int i, Type type) {
        if (b0.j(type)) {
            throw b0.o(this.f2645c, i, "Parameter type must not include a type variable or wildcard: %s", type);
        }
    }
}
