public static ChoosePerson toObject(Map<String, Object> map) { ChoosePerson choosePerson = new ChoosePerson(map); choosePerson.setSpecialPeopleId((Integer) map.get("specialPeopleId")); choosePerson.setSpecialId((String) map.get("specialId")); choosePerson.setPrisonArea((String) map.get("prisonArea")); choosePerson.setDepartment((String) map.get("department")); choosePerson.setJoinPersonName((String) map.get("joinPersonName")); choosePerson.setJoinPersonJinghao((String) map.get("joinPersonJinghao")); choosePerson.setSpecialName((String) map.get("specialName")); return choosePerson; } public static List toObject(List<Map<String, Object>> lists){ List list = new ArrayList(); for (Map map : lists) { ChoosePerson choosePerson = ChoosePerson.toObject(map); if (choosePerson != null) { list.add(choosePerson); } } return list; }
map 转对象,集合
最新推荐文章于 2024-05-23 11:22:29 发布