Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

list to map of list java 8

   Map<String,Set<String>> map =  list.stream().
           collect(Collectors.groupingBy(
                    Student::getName,
                    Collectors.mapping(e->getNum(e.getAddr()), Collectors.toSet())
                ));

   System.out.println("Map : "+map);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #map #list #java
ADD COMMENT
Topic
Name
1+3 =