diff options
Diffstat (limited to 'src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java')
| -rw-r--r-- | src/de/fhswf/in/inf/se/projektthemenvergabe/model/Ansprechpartner.java | 31 |
1 files changed, 30 insertions, 1 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); } /** |
