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

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);
主站蜘蛛池模板: 栾川县| 宝应县| 凌云县| 西畴县| 吴旗县| 福泉市| 远安县| 东台市| 秦皇岛市| 城步| 岐山县| 南涧| 新田县| 五寨县| 石嘴山市| 新宁县| 碌曲县| 龙泉市| 伊吾县| 二连浩特市| 新民市| 随州市| 盐源县| 英超| 肥城市| 台江县| 容城县| 饶河县| 新泰市| 益阳市| 南川市| 萍乡市| 竹山县| 年辖:市辖区| 翁源县| 思茅市| 奎屯市| 偏关县| 大化| 福泉市| 汝城县|