Java 代码优化:使用 Stream API 简化数据处理
<p>private Collection<List<List<Object>>> getSheetDatas(final String activityId) {\n final List<MidLevelDemocracyEvaluationVO> midLevelDemocracyEvaluations = getMidLevelDemocracyEvaluations(activityId);\n final Map<Integer, List<List<Object>>> collect = CollectionUtils.emptyIfNull(midLevelDemocracyEvaluations)\n .stream()\n .collect(Collectors.groupingBy(\n MidLevelDemocracyEvaluationVO::getOrgSort,\n LinkedHashMap::new,\n Collectors.mapping(this::createDataObjects, Collectors.toList())));\n return collect.values();\n}</p>
原文地址: https://www.cveoy.top/t/topic/p9Sa 著作权归作者所有。请勿转载和采集!