这个new typeReference导入的包是package com.alibaba.fastjson;
它还有一个包是package com.fasterxml.jackson.core.type;
/**
*转成对象
**/
LinkedHashMap list1 = (LinkedHashMap) commonResult.getData();
PersonEntity personInfoEntity = JSON.parseObject(JSON.toJSONString(list1), new TypeReference<PersonInfoEntity>() {
});
/**
*这是转成list的例子,转成对象还是map大体上差不多
**/
String provinces = readJsonFile(".//areaCode//provinces.json");
List<NationalCityCode> provinceList = jsonObject.parseObject(provinces, new TypeReference<List<NationalCityCode>>() {});
for (NationalCityCode province : provinceList) {undefined
redisTemplate.opsForValue().set(province.getCode(), province.getName());
}