Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java 8 group a collections by 2 property

Map<String, Map<BlogPostType, List>> map = posts.stream()
  .collect(groupingBy(BlogPost::getAuthor, groupingBy(BlogPost::getType)));
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #java #group #collections #property
ADD COMMENT
Topic
Name
7+3 =