Questions tagged [groupingby]

77 questions
-1
votes
1 answer

Multiple group by java stream collecting to hashMap

I'm have the following objects: List cartItemsList = cart.getItems().stream() .sorted(Comparator.comparingDouble(f -> f.getProduct().getPrice())) .collect(Collectors.toList()); Map
Fidelis
  • 91
  • 1
  • 11
-3
votes
2 answers

Java 8 groupingBy for a list of Maps

I have a list of map for which i want to group them by name List allObjs = new ArrayList(); Map src = new HashMap(); src.put("name", "asset1"); src.put("description", "desc1" ); src.put("definition", "def1" ); Map
Nishanth
  • 66
  • 10
1 2 3 4 5
6