Package com.google.api.client.json.gson
Class GsonGenerator.StringNumber
- java.lang.Object
-
- java.lang.Number
-
- com.google.api.client.json.gson.GsonGenerator.StringNumber
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- GsonGenerator
static final class GsonGenerator.StringNumber extends java.lang.Number
Hack to support numbers encoded as a string for JsonWriter. Unfortunately, JsonWriter doesn't provide a way to print an arbitrary-precision number given a String and instead expects the number to extend Number. So this lets us bypass that problem by overriding the toString() implementation of Number to use our string. Note that this is not actually a valid Number.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
encodedValue
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description StringNumber(java.lang.String encodedValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
float
floatValue()
int
intValue()
long
longValue()
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
encodedValue
private final java.lang.String encodedValue
-
-
Method Detail
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValue
in classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValue
in classjava.lang.Number
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-