package j;

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

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final g.s f6856b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    @Nullable
    public final String f6858d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    @Nullable
    public final g.r f6859e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    @Nullable
    public final g.u f6860f;

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final x<?>[] f6864j;
    public final boolean k;

    public static final class a {

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

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

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

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

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

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

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

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

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

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        public boolean f6874j;
        public boolean k;
        public boolean l;
        public boolean m;
        public boolean n;
        public boolean o;

        @Nullable
        public String p;
        public boolean q;
        public boolean r;
        public boolean s;

        @Nullable
        public String t;

        @Nullable
        public g.r u;

        @Nullable
        public g.u v;

        @Nullable
        public Set<String> w;

        @Nullable
        public x<?>[] x;
        public boolean y;

        public a(d0 d0Var, Method method) {
            this.f6867c = d0Var;
            this.f6868d = method;
            this.f6869e = method.getAnnotations();
            this.f6871g = method.getGenericParameterTypes();
            this.f6870f = 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 z) {
            String str3 = this.p;
            if (str3 != null) {
                throw h0.j(this.f6868d, "Only one HTTP method is allowed. Found: %s and %s.", str3, str);
            }
            this.p = str;
            this.q = z;
            if (str2.isEmpty()) {
                return;
            }
            int iIndexOf = str2.indexOf(63);
            if (iIndexOf != -1 && iIndexOf < str2.length() - 1) {
                String strSubstring = str2.substring(iIndexOf + 1);
                if (f6865a.matcher(strSubstring).find()) {
                    throw h0.j(this.f6868d, "URL query string \"%s\" must not have replace block. For dynamic query parameters use @Query.", strSubstring);
                }
            }
            this.t = str2;
            Matcher matcher = f6865a.matcher(str2);
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            while (matcher.find()) {
                linkedHashSet.add(matcher.group(1));
            }
            this.w = linkedHashSet;
        }

        public final void c(int i2, Type type) {
            if (h0.h(type)) {
                throw h0.l(this.f6868d, i2, "Parameter type must not include a type variable or wildcard: %s", type);
            }
        }
    }

    public a0(a aVar) {
        this.f6855a = aVar.f6868d;
        this.f6856b = aVar.f6867c.f6883c;
        this.f6857c = aVar.p;
        this.f6858d = aVar.t;
        this.f6859e = aVar.u;
        this.f6860f = aVar.v;
        this.f6861g = aVar.q;
        this.f6862h = aVar.r;
        this.f6863i = aVar.s;
        this.f6864j = aVar.x;
        this.k = aVar.y;
    }
}
