// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.math.BigInteger;
import java.math.BigDecimal;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

public class Data1 {
    public static void main(String[] args) throws Exception {
        String json = "{ \"v\": 100000000000000001 }";
        System.out.println(json);
        JsonParser gson = new JsonParser();
        JsonObject o = gson.parse(json).getAsJsonObject();
        int v1 = o.get("v").getAsInt();
        System.out.printf("int: %d\n", v1);
        long v2 = o.get("v").getAsLong();
        System.out.printf("long: %d\n", v2);
        double v3 = o.get("v").getAsDouble();
        System.out.printf("double: %f\n", v3);
        String v4 = o.get("v").getAsString();
        System.out.printf("String: %s\n", v4);
        BigInteger v5 = o.get("v").getAsBigInteger();
        System.out.printf("BigInteger: %s\n", v5);
        BigDecimal v6 = o.get("v").getAsBigDecimal();
        System.out.printf("BigDecimal: %s\n", v6);
    }
}
