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.NumberHack 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.StringencodedValueprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description StringNumber(java.lang.String encodedValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledoubleValue()floatfloatValue()intintValue()longlongValue()java.lang.StringtoString()
-
-
-
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:
doubleValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-