package com.google.firebase.components;

import com.google.android.gms.common.annotation.KeepForSdk;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

@KeepForSdk
public class a$a<T> {
    private final Set<Class<? super T>> buT;
    private final Set<f> buU;
    private d<T> buV;
    public int zzad;

    private a$a(Class<T> cls, Class<? super T>... clsArr) {
        int i = 0;
        AppMethodBeat.i(10601);
        this.buT = new HashSet();
        this.buU = new HashSet();
        this.zzad = 0;
        r.zza(cls, "Null interface");
        this.buT.add(cls);
        int length = clsArr.length;
        while (i < length) {
            r.zza(clsArr[i], "Null interface");
            i++;
        }
        Collections.addAll(this.buT, clsArr);
        AppMethodBeat.o(10601);
    }

    /* synthetic */ a$a(Class cls, Class[] clsArr, byte b) {
        this(cls, clsArr);
    }

    @KeepForSdk
    public final a$a<T> a(d<T> dVar) {
        AppMethodBeat.i(10603);
        this.buV = (d) r.zza(dVar, "Null factory");
        AppMethodBeat.o(10603);
        return this;
    }

    @KeepForSdk
    public final a<T> uA() {
        AppMethodBeat.i(10604);
        r.c(this.buV != null, "Missing required property: factory.");
        a aVar = new a(new HashSet(this.buT), new HashSet(this.buU), this.zzad, this.buV, (byte) 0);
        AppMethodBeat.o(10604);
        return aVar;
    }

    @KeepForSdk
    public final a$a<T> a(f fVar) {
        AppMethodBeat.i(10602);
        r.zza(fVar, "Null dependency");
        String str = "Components are not allowed to depend on interfaces they themselves provide.";
        if ((!this.buT.contains(fVar.buW) ? 1 : null) == null) {
            IllegalArgumentException illegalArgumentException = new IllegalArgumentException(str);
            AppMethodBeat.o(10602);
            throw illegalArgumentException;
        }
        this.buU.add(fVar);
        AppMethodBeat.o(10602);
        return this;
    }
}
