package d4; /* loaded from: classes2.dex */ public abstract class c { private static String a(int i10, int i11, String str) { if (i10 < 0) { return k("%s (%s) must not be negative", str, Integer.valueOf(i10)); } if (i11 >= 0) { return k("%s (%s) must be less than size (%s)", str, Integer.valueOf(i10), Integer.valueOf(i11)); } throw new IllegalArgumentException("negative size: " + i11); } private static String b(int i10, int i11, String str) { if (i10 < 0) { return k("%s (%s) must not be negative", str, Integer.valueOf(i10)); } if (i11 >= 0) { return k("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i10), Integer.valueOf(i11)); } throw new IllegalArgumentException("negative size: " + i11); } private static String c(int i10, int i11, int i12) { return (i10 < 0 || i10 > i12) ? b(i10, i12, "start index") : (i11 < 0 || i11 > i12) ? b(i11, i12, "end index") : k("end index (%s) must not be less than start index (%s)", Integer.valueOf(i11), Integer.valueOf(i10)); } public static void d(boolean z10) { if (!z10) { throw new IllegalArgumentException(); } } public static int e(int i10, int i11) { return f(i10, i11, "index"); } public static int f(int i10, int i11, String str) { if (i10 < 0 || i10 >= i11) { throw new IndexOutOfBoundsException(a(i10, i11, str)); } return i10; } public static Object g(Object obj) { obj.getClass(); return obj; } public static int h(int i10, int i11) { return i(i10, i11, "index"); } public static int i(int i10, int i11, String str) { if (i10 < 0 || i10 > i11) { throw new IndexOutOfBoundsException(b(i10, i11, str)); } return i10; } public static void j(int i10, int i11, int i12) { if (i10 < 0 || i11 < i10 || i11 > i12) { throw new IndexOutOfBoundsException(c(i10, i11, i12)); } } static String k(String str, Object... objArr) { int indexOf; String valueOf = String.valueOf(str); int i10 = 0; if (objArr == null) { objArr = new Object[]{"(Object[])null"}; } StringBuilder sb = new StringBuilder(valueOf.length() + (objArr.length * 16)); int i11 = 0; while (i10 < objArr.length && (indexOf = valueOf.indexOf("%s", i11)) != -1) { sb.append((CharSequence) valueOf, i11, indexOf); sb.append(objArr[i10]); i11 = indexOf + 2; i10++; } sb.append((CharSequence) valueOf, i11, valueOf.length()); if (i10 < objArr.length) { sb.append(" ["); sb.append(objArr[i10]); for (int i12 = i10 + 1; i12 < objArr.length; i12++) { sb.append(", "); sb.append(objArr[i12]); } sb.append(']'); } return sb.toString(); } }