@Target(value=FIELD) @Retention(value=RUNTIME) public @interface JsonString
By default declared Java numeric fields are stored as JSON numbers. For example:
class A {
@Key BigInteger value;
}
can be used for this JSON content:
{"value" : 12345768901234576890123457689012345768901234576890}
However, if instead the JSON content uses a JSON String to store the value, one needs to use
the JsonString
annotation. For example:
class B {
@Key @JsonString BigInteger value;
}
can be used for this JSON content:
{"value" : "12345768901234576890123457689012345768901234576890"}
Copyright © 2011–2022 Google. All rights reserved.