summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe5/Person.java
blob: 24824aec61d855f27ad32f2a39fd6825f14ac4c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
 * 
 */
package de.fhswf.in.inf.java1.aufgabe5;

/**
 * TODO Add comment here
 *
 * @author $Author: $
 * @version $Revision: $, $Date: $ UTC
 */
public class Person
{
   private String vorname;

   private String nachname;

   /**
    * TODO Add constructor comment here
    *
    * @param vorname
    *           First name of the person
    * @param nachname
    *           Last name of the person
    */
   public Person(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 == "")
      {
         throw new IllegalArgumentException("Vorname can't be empty");
      }
      if (nachname == "")
      {
         throw new IllegalArgumentException("Nachname can't be empty");
      }
      this.vorname = vorname;
      this.nachname = nachname;
   }

}