lambda常用语法

64 阅读1分钟

1.List转map

Map<Integer, Person> personMap = personList.stream().collect(Collectors.toMap(Person::getId, person ->person));