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 checkNotNull(@Nullable T t) { t.getClass(); return t; } public static 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"); } } }