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

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);
主站蜘蛛池模板: 旺苍县| 安塞县| 杨浦区| 旬邑县| 改则县| 土默特右旗| 南部县| 台山市| 兰考县| 巴东县| 福安市| 桃园县| 江油市| 瓮安县| 通榆县| 保定市| 泽库县| 冕宁县| 沙湾县| 岳普湖县| 蒙阴县| 凯里市| 巴彦淖尔市| 襄垣县| 襄垣县| 什邡市| 北川| 桐庐县| 汝州市| 富锦市| 宜都市| 祁门县| 自治县| 阜南县| 响水县| 新绛县| 乌海市| 太仆寺旗| 拜泉县| 鄂伦春自治旗| 祁门县|