Fastjson序列化问题

序列化问题

反序列Map复杂对象时的处理方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class ImgRelationshipVO implements Serializable {
private static final long serialVersionUID = 137036203772910249L;
private Long pkRelationship;
private String imgUrl;
private Integer idType;
private Integer imgType;
private String expandType;
private Integer sort;
}
Map<String, List<ImgRelationshipVO>> m = new HashMap<>(10);
// xxxxx存储数据
// 序列化
String imgInfo = JSONObject.toJSONString(m);
// 反序列化
Map<String, List<ImgRelationshipVO>> map = JSONObject.parseObject(imgInfo,new TypeReference<Map<String, List<ImgRelationshipVO>>>() {},Feature.OrderedField);

相关文章

Sublime下载出错问题

Oracle安装出现网络错误

SpringMVC解析json问题

Github代码提交失败设置代理