package IFxWkV_5.QxJ9d_1;

import android.util.TypedValue;
import android.view.View;
/* compiled from: Utils.java */
/* loaded from: classes.dex */
public final class PGPF6hQ_2 {
    static {
        new TypedValue();
    }

    public static View KQgRr5e_0(View view, int i, String str) {
        View findViewById = view.findViewById(i);
        if (findViewById != null) {
            return findViewById;
        }
        String KQgRr5e_0 = KQgRr5e_0(view, i);
        throw new IllegalStateException("Required view '" + KQgRr5e_0 + "' with ID " + i + " for " + str + " was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.");
    }

    public static <T> T QxJ9d_1(View view, int i, String str, Class<T> cls) {
        return (T) KQgRr5e_0(KQgRr5e_0(view, i, str), i, str, cls);
    }

    public static <T> T KQgRr5e_0(View view, int i, String str, Class<T> cls) {
        try {
            return cls.cast(view);
        } catch (ClassCastException e) {
            String KQgRr5e_0 = KQgRr5e_0(view, i);
            throw new IllegalStateException("View '" + KQgRr5e_0 + "' with ID " + i + " for " + str + " was of the wrong type. See cause for more info.", e);
        }
    }

    public static String KQgRr5e_0(View view, int i) {
        return view.isInEditMode() ? "<unavailable while editing>" : view.getContext().getResources().getResourceEntryName(i);
    }
}
