java8 lambda操作
list转mappublic Map<Long, String> getIdNameMap(List<Employee> Employees) { return Employees.stream().collect(Collectors.toMap(Employee::getId, Employee::getUsername));}收集成实体本身mappublic Map<Long, Employee> getIdEmployeeMap(List<
原创
2020-05-09 14:10:50 ·
138 阅读 ·
0 评论