ObjectMapper将List和String互转

ObjectMapper objectMapper = new ObjectMapper();

List<Cell>cells=new ArrayList();

//List转String
String str= objectMapper.writeValueAsString(cells);

//String转List
List<Cell> cellList = objectMapper.readValue(str, new TypeReference<List<Cell>>() {});
原文地址:https://www.cnblogs.com/pzw23/p/14481573.html