View Javadoc
1   package generated.model.de.fhdw.partner;
2   
3   import de.fhdw.wtf.context.model.AnyType;
4   import de.fhdw.wtf.context.model.Str;
5   import de.fhdw.wtf.context.model.collections.MutableList;
6   import de.fhdw.wtf.persistence.meta.UserObject;
7   
8   /**
9    * Represents a natural person.
10   */
11  public class NatuerlichePerson extends AnyType {
12  	
13  	/**
14  	 * The person's name.
15  	 */
16  	private Str name;
17  	/**
18  	 * The person's house number.
19  	 */
20  	private Haus wohnhaft;
21  	/**
22  	 * The person's communication channels.
23  	 */
24  	private MutableList<Kommunikationskanal> kanal;
25  	
26  	/**
27  	 * Returns the person's communication channels.
28  	 * 
29  	 * @return The person's communication channels.
30  	 */
31  	public MutableList<Kommunikationskanal> getKanal() {
32  		return this.kanal;
33  	}
34  	
35  	/**
36  	 * Sets the person's communication channels.
37  	 * 
38  	 * @param kanal
39  	 *            The person's new communication channels.
40  	 */
41  	public void setKanal(final MutableList<Kommunikationskanal> kanal) {
42  		this.kanal = kanal;
43  	}
44  	
45  	/**
46  	 * Creates a NatuerlichePerson object.
47  	 * 
48  	 * @param name
49  	 *            The person's name.
50  	 */
51  	public NatuerlichePerson(final Str name) {
52  		this.name = name;
53  		this.kanal = new MutableList<>();
54  	}
55  	
56  	/**
57  	 * Loads object from database.
58  	 * 
59  	 * @param userObject
60  	 *            The underlying user object.
61  	 */
62  	public NatuerlichePerson(final UserObject userObject) {
63  		super(userObject);
64  	}
65  	
66  	/**
67  	 * Returns the person's name.
68  	 * 
69  	 * @return The person's name.
70  	 */
71  	public Str getName() {
72  		return this.name;
73  	}
74  	
75  	/**
76  	 * Sets the person's name.
77  	 * 
78  	 * @param name
79  	 *            The person's new name.
80  	 */
81  	public void setName(final Str name) {
82  		this.name = name;
83  	}
84  	
85  	@Override
86  	public String toString() {
87  		return this.name.toString();
88  	}
89  	
90  	/**
91  	 * Returns the person's house number.
92  	 * 
93  	 * @return The person's house number.
94  	 */
95  	public Haus getWohnhaft() {
96  		return this.wohnhaft;
97  	}
98  	
99  	/**
100 	 * Sets the person's house number.
101 	 * 
102 	 * @param wohnhaft
103 	 *            The person's new house number.
104 	 */
105 	public void setWohnhaft(final Haus wohnhaft) {
106 		this.wohnhaft = wohnhaft;
107 	}
108 }