Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java stream group by multiple fields

Map<String, Map<Integer, List<Person>>> map = people
    .collect(Collectors.groupingBy(Person::getName,
        Collectors.groupingBy(Person::getAge));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #stream #group #multiple #fields
ADD COMMENT
Topic
Name
5+2 =