JAVA

[JAVA] List 특정 컬럼으로 그룹핑하기

user-anonymous 2021. 11. 17. 14:54
728x90

Map<String,List<SalesCollectViewVo>> postst = list.stream().collect(groupingBy(SalesCollectViewVo::getTmId));
System.out.println(postst.toString());

Map<Tuple, List<BlogPost>> postsPerTypeAndAuthor = posts.stream() .collect(groupingBy(post -> new Tuple(post.getType(), post.getAuthor())));


728x90
반응형