Quantcast
Channel: How to convert a JSON string to a Map with Jackson JSON - Stack Overflow
Viewing all articles
Browse latest Browse all 12

How to convert a JSON string to a Map with Jackson JSON

$
0
0

I'm trying to do something like this but it doesn't work:

Map<String, String> propertyMap = new HashMap<String, String>();propertyMap = JacksonUtils.fromJSON(properties, Map.class);

But the IDE says:

Unchecked assignment Map to Map<String,String>

What's the right way to do this?I'm only using Jackson because that's what is already available in the project, is there a native Java way of converting to/from JSON?

In PHP I would simply json_decode($str) and I'd get back an array. I need basically the same thing here.


Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles



Latest Images