I have json object with arbitary values inside. And I want to deserialize it in a Map. Everything is ok except converting integers to a doubles. See example:
To avoid possible ClassCastException, it is better to cast to Number first. In the following code map was deserialized from JSON as a Map with no generics.
int numberOfPages = ((Number) map.get("number_of_pages")).intValue();