package com.google.android.libraries.places.internal; /* loaded from: classes2.dex */ public final class zzig { public static int zza(int i, int i2, String str) { String zza; if (i >= 0 && i < i2) { return i; } if (i < 0) { zza = zzil.zza("%s (%s) must not be negative", "index", Integer.valueOf(i)); } else if (i2 >= 0) { zza = zzil.zza("%s (%s) must be less than size (%s)", "index", Integer.valueOf(i), Integer.valueOf(i2)); } else { StringBuilder sb = new StringBuilder("negative size: "); sb.append(i2); throw new IllegalArgumentException(sb.toString()); } throw new IndexOutOfBoundsException(zza); } public static int zzb(int i, int i2, String str) { if (i < 0 || i > i2) { throw new IndexOutOfBoundsException(zzl(i, i2, "index")); } return i; } public static Object zzc(Object obj, Object obj2) { if (obj != null) { return obj; } throw new NullPointerException((String) obj2); } public static void zzd(boolean z) { if (!z) { throw new IllegalArgumentException(); } } public static void zze(boolean z, Object obj) { if (!z) { throw new IllegalArgumentException(String.valueOf(obj)); } } public static void zzf(boolean z, String str, char c) { if (!z) { throw new IllegalArgumentException(zzil.zza(str, Character.valueOf(c))); } } public static void zzh(boolean z) { if (!z) { throw new IllegalStateException(); } } public static void zzi(boolean z, Object obj) { if (!z) { throw new IllegalStateException((String) obj); } } public static void zzj(boolean z, String str, int i) { if (!z) { throw new IllegalStateException(zzil.zza(str, Integer.valueOf(i))); } } public static void zzk(boolean z, String str, Object obj, Object obj2, Object obj3) { if (!z) { throw new IllegalStateException(zzil.zza(str, obj, obj2, obj3)); } } private static String zzl(int i, int i2, String str) { if (i < 0) { return zzil.zza("%s (%s) must not be negative", str, Integer.valueOf(i)); } if (i2 < 0) { StringBuilder sb = new StringBuilder("negative size: "); sb.append(i2); throw new IllegalArgumentException(sb.toString()); } return zzil.zza("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i), Integer.valueOf(i2)); } public static void zzg(int i, int i2, int i3) { String zzl; if (i < 0 || i2 < i || i2 > i3) { if (i < 0 || i > i3) { zzl = zzl(i, i3, "start index"); } else if (i2 < 0 || i2 > i3) { zzl = zzl(i2, i3, "end index"); } else { zzl = zzil.zza("end index (%s) must not be less than start index (%s)", Integer.valueOf(i2), Integer.valueOf(i)); } throw new IndexOutOfBoundsException(zzl); } } }