package k3;

import i3.C0639g;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.EnumMap;
import java.util.EnumSet;

/* JADX INFO: loaded from: classes.dex */
public final class f implements p {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ int f8626k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final /* synthetic */ Type f8627l;

    public /* synthetic */ f(Type type, int i) {
        this.f8626k = i;
        this.f8627l = type;
    }

    @Override // k3.p
    public final Object z() {
        switch (this.f8626k) {
            case 0:
                Type type = this.f8627l;
                if (!(type instanceof ParameterizedType)) {
                    throw new C0639g("Invalid EnumSet type: " + type.toString());
                }
                Type type2 = ((ParameterizedType) type).getActualTypeArguments()[0];
                if (type2 instanceof Class) {
                    return EnumSet.noneOf((Class) type2);
                }
                throw new C0639g("Invalid EnumSet type: " + type.toString());
            default:
                Type type3 = this.f8627l;
                if (!(type3 instanceof ParameterizedType)) {
                    throw new C0639g("Invalid EnumMap type: " + type3.toString());
                }
                Type type4 = ((ParameterizedType) type3).getActualTypeArguments()[0];
                if (type4 instanceof Class) {
                    return new EnumMap((Class) type4);
                }
                throw new C0639g("Invalid EnumMap type: " + type3.toString());
        }
    }
}
