Files
rr3-apk/decompiled/sources/com/google/gson/internal/LazilyParsedNumber.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

77 lines
2.0 KiB
Java

package com.google.gson.internal;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamException;
import java.math.BigDecimal;
/* loaded from: classes3.dex */
public final class LazilyParsedNumber extends Number {
private final String value;
public String toString() {
return this.value;
}
public LazilyParsedNumber(String str) {
this.value = str;
}
@Override // java.lang.Number
public int intValue() {
try {
try {
return Integer.parseInt(this.value);
} catch (NumberFormatException unused) {
return (int) Long.parseLong(this.value);
}
} catch (NumberFormatException unused2) {
return new BigDecimal(this.value).intValue();
}
}
@Override // java.lang.Number
public long longValue() {
try {
return Long.parseLong(this.value);
} catch (NumberFormatException unused) {
return new BigDecimal(this.value).longValue();
}
}
@Override // java.lang.Number
public float floatValue() {
return Float.parseFloat(this.value);
}
@Override // java.lang.Number
public double doubleValue() {
return Double.parseDouble(this.value);
}
private Object writeReplace() throws ObjectStreamException {
return new BigDecimal(this.value);
}
private void readObject(ObjectInputStream objectInputStream) throws IOException {
throw new InvalidObjectException("Deserialization is unsupported");
}
public int hashCode() {
return this.value.hashCode();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LazilyParsedNumber)) {
return false;
}
String str = this.value;
String str2 = ((LazilyParsedNumber) obj).value;
return str == str2 || str.equals(str2);
}
}