官术网_书友最值得收藏!

Groupings

The elements of streams can also be grouped using Collectors, returning a map, such that for a key of type T, the Collector generates a Map<T,List<Y>>:

//Grouping Collectors
Map<Integer,List<String>>groupExample= streamSupplier.get().collect(Collectors.groupingBy(x-> x.toString().length()));
System.out.println("Grouping stream elements on the basis of its length :: " + groupExample);
主站蜘蛛池模板: 泸溪县| 余庆县| 泸州市| 白城市| 资溪县| 通山县| 临江市| 莒南县| 大渡口区| 泸州市| 沙河市| 栾川县| 花莲县| 禹城市| 西和县| 仙桃市| 阜城县| 石渠县| 社会| 苏尼特右旗| 保亭| 秦皇岛市| 开封市| 梁平县| 巨野县| 卢氏县| 平陆县| 开鲁县| 留坝县| 韶山市| 锦屏县| 南郑县| 金门县| 安义县| 腾冲县| 铜鼓县| 绥江县| 彝良县| 焉耆| 临桂县| 梓潼县|