summaryrefslogtreecommitdiff
path: root/src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@skas.io>2024-07-25 20:36:11 +1000
committerSzymon Szukalski <szymon@skas.io>2024-07-25 20:36:11 +1000
commitaa9bdd514ab90d0da0391b879255a22c29450e9a (patch)
tree9ddd1de0ab7e376ead06f55bdb32a6190d3647d5 /src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java
parentec81d98e90f9fdb4dd12138a365fbbbb3a8efa5f (diff)
Validate import payload and return create/update stats
- Add validation to /import payload - Move import logic to service bean - Track whether entities have been created or update - Report number of created and updated entities as return value for the import endpoint - Add some test coverage to exercise the validators
Diffstat (limited to 'src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java')
-rw-r--r--src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java117
1 files changed, 0 insertions, 117 deletions
diff --git a/src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java b/src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java
deleted file mode 100644
index f5970c3..0000000
--- a/src/main/java/com/stileeducation/markr/dto/AggregatedTestResultsDTO.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package com.stileeducation.markr.dto;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-import java.util.Objects;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AggregatedTestResultsDTO {
-
- private double mean;
- private double stddev;
- private double min;
- private double max;
- private double p25;
- private double p50;
- private double p75;
- private int count;
-
- // Getters and Setters
- public double getMean() {
- return mean;
- }
-
- public void setMean(double mean) {
- this.mean = mean;
- }
-
- public double getStddev() {
- return stddev;
- }
-
- public void setStddev(double stddev) {
- this.stddev = stddev;
- }
-
- public double getMin() {
- return min;
- }
-
- public void setMin(double min) {
- this.min = min;
- }
-
- public double getMax() {
- return max;
- }
-
- public void setMax(double max) {
- this.max = max;
- }
-
- public double getP25() {
- return p25;
- }
-
- public void setP25(double p25) {
- this.p25 = p25;
- }
-
- public double getP50() {
- return p50;
- }
-
- public void setP50(double p50) {
- this.p50 = p50;
- }
-
- public double getP75() {
- return p75;
- }
-
- public void setP75(double p75) {
- this.p75 = p75;
- }
-
- public int getCount() {
- return count;
- }
-
- public void setCount(int count) {
- this.count = count;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- AggregatedTestResultsDTO that = (AggregatedTestResultsDTO) o;
- return Double.compare(mean, that.mean) == 0
- && Double.compare(stddev, that.stddev) == 0
- && Double.compare(min, that.min) == 0
- && Double.compare(max, that.max) == 0
- && Double.compare(p25, that.p25) == 0
- && Double.compare(p50, that.p50) == 0
- && Double.compare(p75, that.p75) == 0
- && count == that.count;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mean, stddev, min, max, p25, p50, p75, count);
- }
-
- @Override
- public String toString() {
- return "AggregatedTestResultsDTO{" +
- "mean=" + mean +
- ", stddev=" + stddev +
- ", min=" + min +
- ", max=" + max +
- ", p25=" + p25 +
- ", p50=" + p50 +
- ", p75=" + p75 +
- ", count=" + count +
- '}';
- }
-}