Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json工具方法改进:解决集合对象转换不起作用问题,增加数组转换方法 List<Po> dd = new ArrayList<Po>(); Po p = new Po(); p.setId("id"); p.setName("name"); dd.add(p); p = new Po(); p.setId("id1"); p.setName("name1"); dd.add(p);; String json = SimpleStringUtil.object2json(dd); dd = (List<Po>) StringUtil.json2ObjectWithType(json,new JsonTypeReference<List<Po>>(){}); System.out.println(dd); dd = SimpleStringUtil.json2ListObject(json,Po.class); System.out.println(dd); Set<Po> se = SimpleStringUtil.json2LSetObject(json,Po.class); Po[] a = SimpleStringUtil.json2LArrayObject(json,Po.class); json2ListObject("",Po.class);
- Loading branch information