java8中的Collectors.groupingBy用法

 

 

java8二次收集备忘:

Map<Integer,String> mapAnchor = anchors.stream().collect(Collectors.groupingBy(LiveAnchorInfo::getRoomId, Collectors.mapping(LiveAnchorInfo::getName, Collectors.joining(","))));

 

原文:

https://blog.csdn.net/u014231523/article/details/102535902

posted @ 2022-01-20 17:59  君子笑而不语  阅读(377)  评论(0编辑  收藏  举报