Considering the following JSON :
[
{
"map": "TEST",
"values": [
"test",
"test2"
]
},
{
"map": "TEST1",
"values": [
"test",
"test3",
"test4"
]
},
{
"map": "TEST2",
"values": [
"test4",
"test2",
"test5",
"test2"
]
}
]
which have been loaded into a string by the getResourceAsString function. How can I make a HashMap where my key is "map" field, and my value is an array of "values" field ? I tried many solutions in other similar questions, but nothing worked.
Here is the beginning of my code :
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
But I don't know how to assign it to a Map, readValue method doesn't seems to give the right thing