@Override public int compare(MetricData leftMetricData, MetricData rightMetricData) { Date leftMetricDataTimestamp = new Date(leftMetricData.getTimestamp()); Date rightMetricDataTimestamp = new Date(rightMetricData.getTimestamp()); return leftMetricDataTimestamp.compareTo(rightMetricDataTimestamp); }
private List<Column> getChartColumns() { List<Column> chartColumns = new ArrayList<>(metricData.size()); for (MetricData metricData : this.metricData) { MetricAvailability metricAvailability = MetricAvailability.from(metricData.getValue()); float columnValue = getColumnValue(metricAvailability); int columnColor = getColumnColor(metricAvailability); chartColumns.add( new Column(Collections.singletonList(new SubcolumnValue(columnValue, columnColor)))); } return chartColumns; }