Package com.google.gson.internal
Class LazilyParsedNumber
- java.lang.Object
-
- java.lang.Number
-
- com.google.gson.internal.LazilyParsedNumber
-
- All Implemented Interfaces:
java.io.Serializable
public final class LazilyParsedNumber extends java.lang.NumberThis class holds a number value that is lazily converted to a specific number type- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringvalue
-
Constructor Summary
Constructors Constructor Description LazilyParsedNumber(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.math.BigDecimalasBigDecimal()doubledoubleValue()booleanequals(java.lang.Object obj)floatfloatValue()inthashCode()intintValue()longlongValue()private voidreadObject(java.io.ObjectInputStream in)java.lang.StringtoString()private java.lang.ObjectwriteReplace()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.
-
-
-
Method Detail
-
asBigDecimal
private java.math.BigDecimal asBigDecimal()
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classjava.lang.Number
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
writeReplace
private java.lang.Object writeReplace() throws java.io.ObjectStreamExceptionIf 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:
java.io.ObjectStreamException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-