Class GsonGenerator.StringNumber

java.lang.Object
java.lang.Number
com.google.api.client.json.gson.GsonGenerator.StringNumber
All Implemented Interfaces:
Serializable
Enclosing class:
GsonGenerator

static final class GsonGenerator.StringNumber extends 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 Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • encodedValue

      private final String encodedValue
  • Constructor Details

    • StringNumber

      StringNumber(String encodedValue)
  • Method Details