71 lines
2.4 KiB
Java
71 lines
2.4 KiB
Java
package com.google.common.collect;
|
|
|
|
import com.google.common.base.Preconditions;
|
|
|
|
/* loaded from: classes2.dex */
|
|
final class CollectPreconditions {
|
|
CollectPreconditions() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void checkEntryNotNull(Object obj, Object obj2) {
|
|
if (obj == null) {
|
|
String valueOf = String.valueOf(obj2);
|
|
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 24);
|
|
sb.append("null key in entry: null=");
|
|
sb.append(valueOf);
|
|
throw new NullPointerException(sb.toString());
|
|
}
|
|
if (obj2 != null) {
|
|
return;
|
|
}
|
|
String valueOf2 = String.valueOf(obj);
|
|
StringBuilder sb2 = new StringBuilder(String.valueOf(valueOf2).length() + 26);
|
|
sb2.append("null value in entry: ");
|
|
sb2.append(valueOf2);
|
|
sb2.append("=null");
|
|
throw new NullPointerException(sb2.toString());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static int checkNonnegative(int i, String str) {
|
|
if (i >= 0) {
|
|
return i;
|
|
}
|
|
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 40);
|
|
sb.append(str);
|
|
sb.append(" cannot be negative but was: ");
|
|
sb.append(i);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static long checkNonnegative(long j, String str) {
|
|
if (j >= 0) {
|
|
return j;
|
|
}
|
|
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 49);
|
|
sb.append(str);
|
|
sb.append(" cannot be negative but was: ");
|
|
sb.append(j);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void checkPositive(int i, String str) {
|
|
if (i > 0) {
|
|
return;
|
|
}
|
|
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 38);
|
|
sb.append(str);
|
|
sb.append(" must be positive but was: ");
|
|
sb.append(i);
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void checkRemove(boolean z) {
|
|
Preconditions.checkState(z, "no calls to next() since the last call to remove()");
|
|
}
|
|
}
|