Package com.google.gson.internal
Class LazilyParsedNumber
java.lang.Object
java.lang.Number
com.google.gson.internal.LazilyParsedNumber
- All Implemented Interfaces:
Serializable
This class holds a number value that is lazily converted to a specific number type
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BigDecimal
double
boolean
float
int
hashCode()
int
intValue()
long
private void
toString()
private Object
If somebody is unlucky enough to have to serialize one of these, serialize it as a BigDecimal so that they won't need Gson on the other side to deserialize it.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
value
-
-
Constructor Details
-
LazilyParsedNumber
- Parameters:
value
- must not be null
-
-
Method Details
-
asBigDecimal
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
toString
-
writeReplace
If somebody is unlucky enough to have to serialize one of these, serialize it as a BigDecimal so that they won't need Gson on the other side to deserialize it.- Throws:
ObjectStreamException
-
readObject
- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-