I have a json String that's a list of a list of strings, and need to convert it to objects of class List<List<String>>
.
Here it says how to convert from string to a list, but it doesn't work for me as I cannot specify the List<List<String>>
class in constructCollectionType
This is my attempt, that doesn't work:
ObjectMapper objectMapper = new ObjectMapper();
TypeFactory typeFactory = objectMapper.getTypeFactory();
List<List<String>> list = objectMapper.readValue(response,
typeFactory.constructCollectionType(List.class, List.class));
How to achieve this?