package defpackage;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/* JADX INFO: loaded from: classes2.dex */
public final class e91<T> {
    public final String a;
    public final Set b;
    public final Set c;
    public final int d;
    public final int e;
    public final s91 f;
    public final Set g;

    public e91(String str, Set set, Set set2, int i, int i2, s91 s91Var, Set set3) {
        this.a = str;
        this.b = Collections.unmodifiableSet(set);
        this.c = Collections.unmodifiableSet(set2);
        this.d = i;
        this.e = i2;
        this.f = s91Var;
        this.g = Collections.unmodifiableSet(set3);
    }

    public static b a(lm7 lm7Var) {
        return new b(lm7Var, new lm7[0]);
    }

    public static b b(Class cls) {
        return new b(cls, new Class[0]);
    }

    public static e91 c(Object obj, Class cls, Class... clsArr) {
        b bVar = new b(cls, clsArr);
        bVar.f = new dj1(obj, 12);
        return bVar.b();
    }

    public final String toString() {
        return "Component<" + Arrays.toString(this.b.toArray()) + ">{" + this.d + ", type=" + this.e + ", deps=" + Arrays.toString(this.c.toArray()) + "}";
    }

    public static class b<T> {
        public String a = null;
        public final HashSet b;
        public final HashSet c;
        public int d;
        public int e;
        public s91 f;
        public final HashSet g;

        public b(Class cls, Class[] clsArr) {
            HashSet hashSet = new HashSet();
            this.b = hashSet;
            this.c = new HashSet();
            this.d = 0;
            this.e = 0;
            this.g = new HashSet();
            hashSet.add(lm7.a(cls));
            for (Class cls2 : clsArr) {
                jf7.a(cls2, "Null interface");
                this.b.add(lm7.a(cls2));
            }
        }

        public final void a(v42 v42Var) {
            if (this.b.contains(v42Var.a)) {
                throw new IllegalArgumentException("Components are not allowed to depend on interfaces they themselves provide.");
            }
            this.c.add(v42Var);
        }

        public final e91 b() {
            if (this.f != null) {
                return new e91(this.a, new HashSet(this.b), new HashSet(this.c), this.d, this.e, this.f, this.g);
            }
            throw new IllegalStateException("Missing required property: factory.");
        }

        public final void c() {
            if (!(this.d == 0)) {
                throw new IllegalStateException("Instantiation type has already been set.");
            }
            this.d = 2;
        }

        public b(lm7 lm7Var, lm7[] lm7VarArr) {
            HashSet hashSet = new HashSet();
            this.b = hashSet;
            this.c = new HashSet();
            this.d = 0;
            this.e = 0;
            this.g = new HashSet();
            hashSet.add(lm7Var);
            for (lm7 lm7Var2 : lm7VarArr) {
                jf7.a(lm7Var2, "Null interface");
            }
            Collections.addAll(this.b, lm7VarArr);
        }
    }
}
