list对象装map
Map<String, WordAttributeVo> voMap = VoList.stream().collect(Collectors.toMap(WordAttributeVo::getId, Function.identity()));
Map<String, WordAttributeVo> voMap = VoList.stream().collect(Collectors.toMap(WordAttributeVo::getId,WordAttributeVo -> WordAttributeVo));
map转list对象
List<Person> list = map.entrySet().stream().sorted(Comparator.comparing(e -> e.getKey()))
.map(e -> new Person(e.getKey(), e.getValue())).collect(Collectors.toList());
List<Person> list = map.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getValue))
.map(e -> new Person(e.getKey(), e.getValue())).collect(Collectors.toList());
List<Person> list = map.entrySet().stream().sorted(Map.Entry.comparingByKey())
.map(e -> new Person(e.getKey(), e.getValue())).collect(Collectors.toList());
Map<String, QiaoxueWordQo> voMaps = Maps.newHashMap();
Iterator it = voMap.entrySet().iterator();
//复制值到另一个map防止删除时索引不对报错
while(it.hasNext()) {
Map.Entry entry=(Map.Entry)it.next();
Object key=entry.getKey();
if(key!=null && voMap.get(key)!=null) {
voMaps.put(key.toString(), voMap.get(key));
}
}