aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDominic Rogetzer <e1627756@student.tuwien.ac.at>2018-05-01 16:14:04 +0200
committerDominic Rogetzer <e01627756@student.tuwien.ac.at>2018-05-03 22:48:30 +0200
commit795f86fb257c6d5099886390b4dfe9971f5a6371 (patch)
tree42e55c9a5e05efbf83c83c8c9ad1a5abaaf99ee0 /src
parent715a289ec50e38a6fb0b623720ac39b5398a849a (diff)
downloadsepm-groupproject-795f86fb257c6d5099886390b4dfe9971f5a6371.tar.gz
sepm-groupproject-795f86fb257c6d5099886390b4dfe9971f5a6371.tar.xz
sepm-groupproject-795f86fb257c6d5099886390b4dfe9971f5a6371.zip
create EmployeeValidator
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java
new file mode 100644
index 0000000..d7fa9aa
--- /dev/null
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java
@@ -0,0 +1,23 @@
+package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto;
+
+import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidEmployeeException;
+
+public class EmployeeValidator {
+
+ public static boolean validate(Employee employee) throws InvalidEmployeeException {
+
+ if (employee.name() == null || employee.name().trim().length() == 0) {
+ throw new InvalidEmployeeException("name not set");
+ }
+
+ if (employee.birthday() == null) {
+ throw new InvalidEmployeeException("birthday not set");
+ }
+
+ if (employee.educationLevel() == null) {
+ throw new InvalidEmployeeException("educationLevel not set");
+ }
+
+ return true;
+ }
+}