Rabbit-R1/switch port/java/sources/com/google/common/primitives/ParseRequest.java
2024-05-21 17:08:36 -04:00

33 lines
947 B
Java

package com.google.common.primitives;
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.dex */
final class ParseRequest {
final int radix;
final String rawValue;
private ParseRequest(String str, int i) {
this.rawValue = str;
this.radix = i;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static ParseRequest fromString(String str) {
if (str.length() == 0) {
throw new NumberFormatException("empty string");
}
char charAt = str.charAt(0);
int i = 16;
if (str.startsWith("0x") || str.startsWith("0X")) {
str = str.substring(2);
} else if (charAt == '#') {
str = str.substring(1);
} else if (charAt != '0' || str.length() <= 1) {
i = 10;
} else {
str = str.substring(1);
i = 8;
}
return new ParseRequest(str, i);
}
}