首页 > TAG信息列表 > ChartDataView

Stream 分组,BigDecimal求和汇总

// 分组 Map<String, List<ChartDataView>> map = data.stream().map(t -> { ChartDataView c = new ChartDataView(); c.setDimension1(t.getDimension10()); c.setTarget1(t.getTarget7()); return c; }).collect(Collectors.

拼接List的属性成str

// 法一 String fieldStr = list.stream().map(n -> n.getDimension1()).collect(Collectors.joining(",")); // 法二 List<String> fieldList = Lists.newArrayList(); for (ChartDataView chartDataView : list) { fieldList.add(chartDataView.getDimen