ArrayList<Map<Object, Object>> 的深拷贝

66 阅读1分钟

求一个好用的方法,我想不到了。只能for笨方法

ArrayList<Map<String, Object>> pj22Files = new ArrayList<>();
for (Map<String, Object> m : pj22) {
    HashMap<String, Object> o = new HashMap<>();
    o.putAll(m);
    pj22Files.add(o);
}