多字段map
Map<Integer, String> map = list.stream().collect(Collectors.toMap(Entity::getId, Entity::getType)); //可改成 Map<Integer, String> map = list.stream().collect(HashMap::new, (k, v) -> k.put(v.getId(), v.getType()),HashMap::putAll);
标签:map,java,stream,Map,getType,list
From: https://www.cnblogs.com/zenple/p/17097421.html