Java遍历map
List<Mtsubstation> mtsubstations = mtsubstationDao.selectListWithTransformer(); Map<String, List<Mtsubstation>> mapTemp = mtsubstations.stream().collect(groupingBy(Mtsubstation::getVoltageLevelName)); for (Map.Entry<String, List<Mtsubstation>> entry : mapTemp.entrySet()) { // System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue()); }
==

浙公网安备 33010602011771号