diff options
| author | Szymon Szukalski <szymon@skas.io> | 2024-07-23 14:48:26 +1000 |
|---|---|---|
| committer | Szymon Szukalski <szymon@skas.io> | 2024-07-23 14:48:26 +1000 |
| commit | fc96ec673822d9f1cbe0e5eb004c12b7f8f2db9b (patch) | |
| tree | 848e9b7e2f7958b168b1494531dae2ffc5e9f81e /src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java | |
| parent | d4c94470514f28849a5b3cbd9d04982825187554 (diff) | |
Create JAXB beans and initial test for request model
Diffstat (limited to 'src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java')
| -rw-r--r-- | src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java b/src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java new file mode 100644 index 0000000..a67d19c --- /dev/null +++ b/src/main/java/com/stileeducation/markr/dto/SummaryMarksDTO.java @@ -0,0 +1,51 @@ +package com.stileeducation.markr.dto; + +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; + +import java.util.Objects; + +@XmlRootElement(name = "summary-marks") +public class SummaryMarksDTO { + private int available; + private int obtained; + + @XmlAttribute(name = "available") + public int getAvailable() { + return available; + } + + public void setAvailable(int available) { + this.available = available; + } + + @XmlAttribute(name = "obtained") + public int getObtained() { + return obtained; + } + + public void setObtained(int obtained) { + this.obtained = obtained; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SummaryMarksDTO that = (SummaryMarksDTO) o; + return available == that.available && obtained == that.obtained; + } + + @Override + public int hashCode() { + return Objects.hash(available, obtained); + } + + @Override + public String toString() { + return "SummaryMarksDTO{" + + "available=" + available + + ", obtained=" + obtained + + '}'; + } +} |
