Jackson 字符串转List<Map>
String a = "[{\"id\":27,\"text\":\"网络\"},{\"id\":32,\"text\":\"机身内存\"}]"; ObjectMapper objectMapper = new ObjectMapper(); CollectionLikeType type = objectMapper.getTypeFactory().constructCollectionLikeType(List.class, Map.class); List<Map> listMap = objectMapper.readValue(a, type);
ObjectMapper objectMapper = new ObjectMapper();
CollectionLikeType type = objectMapper.getTypeFactory().constructCollectionLikeType(List.class, Map.class);
List<Map> listMap = objectMapper.readValue(typeTemplate.getSpecIds(), type);