JsonBigDecimalNumber incompatible with javax json JsonString

Viewed 73

I have a jsonObject. I would like to extract values from it. The type of the field that I would like to extract it is long

My code:

JsonObject rec = my_files.getJsonObject(i);                 
JsonString timestamps = rec.getJsonString("timestamps");

I got an exception when getting t:

  Exception in thread "main" java.lang.ClassCastException: org.glassfish.json.JsonNumberImpl$JsonBigDecimalNumber incompatible with javax.json.JsonString

As my understanding, the exception telling me that I'm trying to convert JSONNumber into JsonString.

How can I extract the timestamps field please ? Thanks

1 Answers
Related