package butterknife.internal; import android.util.TypedValue; import android.view.View; /* loaded from: classes.dex */ public final class Utils { static { new TypedValue(); } public static View a(View view, int i, String str) { View findViewById = view.findViewById(i); if (findViewById != null) { return findViewById; } throw new IllegalStateException("Required view '" + a(view, i) + "' with ID " + i + " for " + str + " was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation."); } public static T b(View view, int i, String str, Class cls) { return (T) a(a(view, i, str), i, str, cls); } public static T a(View view, int i, String str, Class cls) { try { return cls.cast(view); } catch (ClassCastException e) { throw new IllegalStateException("View '" + a(view, i) + "' with ID " + i + " for " + str + " was of the wrong type. See cause for more info.", e); } } private static String a(View view, int i) { return view.isInEditMode() ? "" : view.getContext().getResources().getResourceEntryName(i); } }