diff options
Diffstat (limited to 'src/de/fhswf/in/inf/se/projektthemenvergabe/model')
4 files changed, 76 insertions, 5 deletions
diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java index ce28c51..6a29db5 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java @@ -58,15 +58,44 @@ public class Ansprechpartner * Constructor of Ansprechpartner. * * @param organisation + * The {@link Organisation} of the {@link Ansprechpartner}. + * @param vorname + * The vorname of the {@link Ansprechpartner}. + * @param nachname + * The nachname of the {@link Ansprechpartner}. */ - public Ansprechpartner(Organisation organisation) + public Ansprechpartner(Organisation organisation, String vorname, + String nachname) { + if (vorname == null) + { + throw new IllegalArgumentException("Vorname can't be null."); + } + + if (nachname == null) + { + throw new IllegalArgumentException("Nachname can't be null."); + } + + if (vorname.isEmpty()) + { + throw new IllegalArgumentException("Vorname can't be empty."); + } + + if (nachname.isEmpty()) + { + throw new IllegalArgumentException("Nachname can't be empty."); + } + this.organisation.set(organisation); if (organisation != null) { this.organisation.get().addAnsprechpartner(this); } + + this.vorname.set(vorname); + this.nachname.set(nachname); } /** diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Organisation.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Organisation.java index b9a6da4..ab90403 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Organisation.java +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Organisation.java @@ -34,6 +34,27 @@ public class Organisation } /** + * Constructor of {@link Organisation}. + * + * @param name + * The name of the {@link Organisation}. + */ + public Organisation(String name) + { + if (name == null) + { + throw new IllegalArgumentException("Name can't be null."); + } + + if (name.isEmpty()) + { + throw new IllegalArgumentException("Name can't be empty."); + } + + this.name.set(name); + } + + /** * Getter for property name. * * @return Returns the name. diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Projekt.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Projekt.java index 91fd89e..e52e2d8 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Projekt.java +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Projekt.java @@ -75,6 +75,8 @@ public class Projekt * * Constructor of Project. * + * @param projektthema + * The name of the {@link Projekt}. * @param student1 * The first Student * @param student2 @@ -84,13 +86,20 @@ public class Projekt * @param ansprechpartner * The Ansprechpartner */ - public Projekt( - - Student student1, Student student2, - + public Projekt(String projektthema, Student student1, Student student2, Student student3, Ansprechpartner ansprechpartner) { + if (projektthema == null) + { + throw new IllegalArgumentException("Projektthema can't be null."); + } + + if (projektthema.isEmpty()) + { + throw new IllegalArgumentException("Projektthema can't be empty."); + } + if (student1 == null && student2 == null && student3 == null) { throw new IllegalArgumentException( @@ -123,6 +132,7 @@ public class Projekt this.ansprechpartner = ansprechpartner; this.ansprechpartner.addProjekt(this); + this.projektthema.set(projektthema); } /** diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Student.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Student.java index 6890714..1ba6ed5 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Student.java +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/model/Student.java @@ -23,6 +23,17 @@ public class Student private Projekt projekt; /** + * Constructor of {@link Student}. + * + * @param matrikelnummer + * Matrikelnummer of the Student. + */ + public Student(int matrikelnummer) + { + this.matrikelnummer.set(matrikelnummer); + } + + /** * * Getter for the property vorname. * |
