Fixed variable declaration.

This commit is contained in:
neviyn 2018-09-18 09:03:27 +01:00
parent 85cbc4d062
commit 411f6ca38c

View File

@ -4,27 +4,29 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull; import lombok.NonNull;
/** /**
* AverageStats in a format easily readable by Chart.js * AverageStats in a format easily readable by Chart.js
*/ */
@Data
public class AverageStatsChartJs { public class AverageStatsChartJs {
@NonNull @NonNull
@JsonProperty @JsonProperty
private List<String> labels = new ArrayList<String>(); private List<String> labels = new ArrayList<>();
@NonNull @NonNull
@JsonProperty @JsonProperty
List<Dataset> datasets = new ArrayList<Dataset>(); private List<Dataset> datasets = new ArrayList<>();
public AverageStatsChartJs(List<AverageStats> inputData){ public AverageStatsChartJs(List<AverageStats> inputData){
List<Float> monitoring = new ArrayList<Float>(), List<Float> monitoring = new ArrayList<>(),
control = new ArrayList<Float>(), control = new ArrayList<>(),
conservatism = new ArrayList<Float>(), conservatism = new ArrayList<>(),
teamwork = new ArrayList<Float>(), teamwork = new ArrayList<>(),
knowledge = new ArrayList<Float>(); knowledge = new ArrayList<>();
for(AverageStats averageStats: inputData){ for(AverageStats averageStats: inputData){
labels.add(averageStats.getDate().toString()); labels.add(averageStats.getDate().toString());
monitoring.add(averageStats.getMonitoring()); monitoring.add(averageStats.getMonitoring());