List<Map> list = new ArrayList<>(); Map<String,Object> fieldMap = new HashMap<>(); fieldMap.put("user_name","admin"); fieldMap.put("dept_id","100");
//获取所有的key for (String s : fieldMap.keySet()) { System.out.println(s); }
//获取所有的value for (Object s : fieldMap.values()) { System.out.println(s); }
//设置value值 for (Map.Entry s : fieldMap.entrySet()) { s.setValue("ces"); }
// for (Object s : fieldMap.values()) { System.out.println(s); }
运行结果
user_name
dept_id
admin
100
ces
ces