- java.lang.Object
-
- java.lang.Number
-
- com.google.gson.internal.LazilyParsedNumber
-
- All Implemented Interfaces:
java.io.Serializable
public final class LazilyParsedNumber extends java.lang.Number
This 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.String
value
-
Constructor Summary
Constructors Constructor Description LazilyParsedNumber(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
boolean
equals(java.lang.Object obj)
float
floatValue()
int
hashCode()
int
intValue()
long
longValue()
private void
readObject(java.io.ObjectInputStream in)
java.lang.String
toString()
private java.lang.Object
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.
-
-
-
Method Detail
-
intValue
public int intValue()
- Specified by:
intValue
in classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValue
in classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classjava.lang.Number
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classjava.lang.Number
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeReplace
private java.lang.Object writeReplace() throws java.io.ObjectStreamException
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:
java.io.ObjectStreamException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-