public List<Map<String, Object>> toListMap(List<ActiveAlarm> userList) {
List<Map<String, Object>> result = new ArrayList<>();
for (ActiveAlarm activeAlarm : userList) {
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(activeAlarm), new TypeReference<Map<String, Object>>(){});
result.add(map);
}
return result;
}
List「Object」转List「Map」
最新推荐文章于 2024-04-09 17:07:33 发布