- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
111 lines
3.6 KiB
Java
111 lines
3.6 KiB
Java
package com.google.common.base;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public abstract class Preconditions {
|
|
public static void checkArgument(boolean z) {
|
|
if (!z) {
|
|
throw new IllegalArgumentException();
|
|
}
|
|
}
|
|
|
|
public static void checkArgument(boolean z, Object obj) {
|
|
if (!z) {
|
|
throw new IllegalArgumentException(String.valueOf(obj));
|
|
}
|
|
}
|
|
|
|
public static void checkArgument(boolean z, String str, int i, int i2) {
|
|
if (!z) {
|
|
throw new IllegalArgumentException(Strings.lenientFormat(str, Integer.valueOf(i), Integer.valueOf(i2)));
|
|
}
|
|
}
|
|
|
|
public static void checkState(boolean z, Object obj) {
|
|
if (!z) {
|
|
throw new IllegalStateException(String.valueOf(obj));
|
|
}
|
|
}
|
|
|
|
public static void checkState(boolean z, String str, Object obj) {
|
|
if (!z) {
|
|
throw new IllegalStateException(Strings.lenientFormat(str, obj));
|
|
}
|
|
}
|
|
|
|
public static Object checkNotNull(Object obj) {
|
|
obj.getClass();
|
|
return obj;
|
|
}
|
|
|
|
public static Object checkNotNull(Object obj, Object obj2) {
|
|
if (obj != null) {
|
|
return obj;
|
|
}
|
|
throw new NullPointerException(String.valueOf(obj2));
|
|
}
|
|
|
|
public static int checkElementIndex(int i, int i2) {
|
|
return checkElementIndex(i, i2, "index");
|
|
}
|
|
|
|
public static int checkElementIndex(int i, int i2, String str) {
|
|
if (i < 0 || i >= i2) {
|
|
throw new IndexOutOfBoundsException(badElementIndex(i, i2, str));
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public static String badElementIndex(int i, int i2, String str) {
|
|
if (i < 0) {
|
|
return Strings.lenientFormat("%s (%s) must not be negative", str, Integer.valueOf(i));
|
|
}
|
|
if (i2 < 0) {
|
|
StringBuilder sb = new StringBuilder(26);
|
|
sb.append("negative size: ");
|
|
sb.append(i2);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
return Strings.lenientFormat("%s (%s) must be less than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
|
|
}
|
|
|
|
public static int checkPositionIndex(int i, int i2) {
|
|
return checkPositionIndex(i, i2, "index");
|
|
}
|
|
|
|
public static int checkPositionIndex(int i, int i2, String str) {
|
|
if (i < 0 || i > i2) {
|
|
throw new IndexOutOfBoundsException(badPositionIndex(i, i2, str));
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public static String badPositionIndex(int i, int i2, String str) {
|
|
if (i < 0) {
|
|
return Strings.lenientFormat("%s (%s) must not be negative", str, Integer.valueOf(i));
|
|
}
|
|
if (i2 < 0) {
|
|
StringBuilder sb = new StringBuilder(26);
|
|
sb.append("negative size: ");
|
|
sb.append(i2);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
return Strings.lenientFormat("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2));
|
|
}
|
|
|
|
public static void checkPositionIndexes(int i, int i2, int i3) {
|
|
if (i < 0 || i2 < i || i2 > i3) {
|
|
throw new IndexOutOfBoundsException(badPositionIndexes(i, i2, i3));
|
|
}
|
|
}
|
|
|
|
public static String badPositionIndexes(int i, int i2, int i3) {
|
|
if (i < 0 || i > i3) {
|
|
return badPositionIndex(i, i3, "start index");
|
|
}
|
|
if (i2 < 0 || i2 > i3) {
|
|
return badPositionIndex(i2, i3, "end index");
|
|
}
|
|
return Strings.lenientFormat("end index (%s) must not be less than start index (%s)", Integer.valueOf(i2), Integer.valueOf(i));
|
|
}
|
|
}
|