java8 sum

  • A+
所属分类:Java

//这两部分效果相同

    monitorCount = tableNameList.stream().mapToDouble(tableName -> multiSourceMapper.getCountByMonitorTableName((String) tableName, wrapper)).sum();

    for (Object tableName : tableNameList) {

        monitorCount = monitorCount + multiSourceMapper.getCountByMonitorTableName((String) tableName, wrapper);

    }

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: