Annotation Type JsonString (1.42.0)

public interface JsonString implements Annotation

Use this annotation to specify that a declared numeric Java field should map to a JSON string.

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"}
 
 

Implements

Annotation