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

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);
主站蜘蛛池模板: 福清市| 伊宁市| 泰宁县| 孟津县| 昆明市| 海兴县| 蒙山县| 永登县| 大厂| 江源县| 青川县| 台北县| 太仆寺旗| 若羌县| 娱乐| 洮南市| 子洲县| 米泉市| 志丹县| 镇雄县| 衡水市| 新民市| 舟山市| 定陶县| 将乐县| 连江县| 栾城县| 乡宁县| 玉树县| 永平县| 应城市| 大关县| 阜南县| 哈密市| 团风县| 闻喜县| 安宁市| 河东区| 辰溪县| 新竹市| 彰武县|