/** * Generates the dimension names and its unique id map from Result for custom serialization. * * @param result Result object for the custom serialization * * @return custom map of dimension names and their respective unique id */ private Map<String, String> getDimensionValues(Result result) { return result.getDimensionRows().entrySet().stream().collect(Collectors.toMap( columnRow -> columnRow.getKey().getName(), columnRow -> columnRow.getValue().get(columnRow.getKey().getDimension().getKey()) )); }
/** * Expand the result by adding a new metric column with the row number as the metric value. * * @param result Result to expand * @param metricColumn New column to add * @param rowNum Row number to use as the metric value * * @return the expanded Result */ private Result rowNumMap(Result result, MetricColumn metricColumn, int rowNum) { Map<MetricColumn, Object> metricValues = new LinkedHashMap<>(result.getMetricValues()); metricValues.put(metricColumn, BigDecimal.valueOf(rowNum)); return new Result(result.getDimensionRows(), metricValues, result.getTimeStamp()); } }
Map<DimensionColumn, DimensionRow> dr = result.getDimensionRows(); for (Entry<DimensionColumn, DimensionRow> dce : dr.entrySet()) { DimensionRow drow = dce.getValue();
Map<DimensionColumn, DimensionRow> dr = result.getDimensionRows(); for (Entry<DimensionColumn, DimensionRow> dimensionColumnEntry : dr.entrySet()) {