/** * */ package de.fhswf.in.inf.java1.aufgabe5; /** * A person which can own an account. * * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class Person { private String vorname; private String nachname; /** * Creates a person with first and last name. * * @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; } /** * Just for getting the persons name. * * @return Returns the full name of the person */ public String getName() { return vorname + " " + nachname; } }