You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when Jackson deserializes a number in an untyped context (eg Object), Jackson returns either Integer or Long depending on the size. This requires endless littering of boilerplate casts and conversions throughout code, for example:
Map<String, Object> map = mapper.readValue(payload, Map.class);
//long value = (Long)map.get("key"); // throws class cast exceptionlongvalue = ((Number)map.get("key")).longValue; // gack
It would be fantastic if Jackson had an option to force all untyped numbers to Long instead of Integer. I propose DeserializationFeature.USE_LONG_FOR_INTS to be consistent with other features.
The text was updated successfully, but these errors were encountered:
Currently, when Jackson deserializes a number in an untyped context (eg Object), Jackson returns either Integer or Long depending on the size. This requires endless littering of boilerplate casts and conversions throughout code, for example:
It would be fantastic if Jackson had an option to force all untyped numbers to Long instead of Integer. I propose DeserializationFeature.USE_LONG_FOR_INTS to be consistent with other features.
The text was updated successfully, but these errors were encountered: