lamada表达式

集合中获取元素属性的集合:

List<CourseLessonExt> taglist = map.get(CourseLessonExtTypeEnum.TAG.getIndex());
List<String> tagIdList=taglist.stream()
    .map((clExt)->clExt.getRefId()).collect(Collectors.toList());
分组:
Map<String, List<DraftNoticeInfoDTO>> map = draftNoticeInfoDTOS.stream()
 .collect(Collectors.groupingBy(DraftNoticeInfoDTO::getLevlTypeName, HashMap::new, Collectors.toList()));

 

posted @ 2022-03-13 23:11  VNone  阅读(10)  评论(0)    收藏  举报