- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
75 lines
1.9 KiB
Java
75 lines
1.9 KiB
Java
package com.mbridge.msdk.playercommon.exoplayer2.util;
|
|
|
|
import android.os.Looper;
|
|
import android.text.TextUtils;
|
|
import androidx.annotation.Nullable;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class Assertions {
|
|
private Assertions() {
|
|
}
|
|
|
|
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 int checkIndex(int i, int i2, int i3) {
|
|
if (i < i2 || i >= i3) {
|
|
throw new IndexOutOfBoundsException();
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public static void checkState(boolean z) {
|
|
if (!z) {
|
|
throw new IllegalStateException();
|
|
}
|
|
}
|
|
|
|
public static void checkState(boolean z, Object obj) {
|
|
if (!z) {
|
|
throw new IllegalStateException(String.valueOf(obj));
|
|
}
|
|
}
|
|
|
|
public static <T> T checkNotNull(@Nullable T t) {
|
|
t.getClass();
|
|
return t;
|
|
}
|
|
|
|
public static <T> T checkNotNull(@Nullable T t, Object obj) {
|
|
if (t != null) {
|
|
return t;
|
|
}
|
|
throw new NullPointerException(String.valueOf(obj));
|
|
}
|
|
|
|
public static String checkNotEmpty(@Nullable String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
throw new IllegalArgumentException();
|
|
}
|
|
return str;
|
|
}
|
|
|
|
public static String checkNotEmpty(@Nullable String str, Object obj) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
throw new IllegalArgumentException(String.valueOf(obj));
|
|
}
|
|
return str;
|
|
}
|
|
|
|
public static void checkMainThread() {
|
|
if (Looper.myLooper() != Looper.getMainLooper()) {
|
|
throw new IllegalStateException("Not in applications main thread");
|
|
}
|
|
}
|
|
}
|