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.collections.MutableList;
5   import de.fhdw.wtf.context.model.collections.MutableMap;
6   import de.fhdw.wtf.persistence.meta.UserObject;
7   
8   /**
9    * Represents a list of phone books. Note, however, that the phone books are _not_ represented as
10   * TelefonbuchMitPersonAlsKey objects.
11   */
12  public class Telefonbuecher extends AnyType {
13  	
14  	/**
15  	 * A list of maps from persons to lists of phone numbers.
16  	 */
17  	private MutableList<MutableMap<NatuerlichePerson, MutableList<Telefon>>> eintraege;
18  	
19  	/**
20  	 * Creates an empty Telefonbuecher object.
21  	 */
22  	public Telefonbuecher() {
23  		this.eintraege = new MutableList<>();
24  	}
25  	
26  	/**
27  	 * Loads object from database.
28  	 * 
29  	 * @param userObject
30  	 *            The underlying user object.
31  	 */
32  	public Telefonbuecher(final UserObject userObject) {
33  		super(userObject);
34  	}
35  	
36  	/**
37  	 * Returns the list of maps from persons to lists of phone numbers.
38  	 * 
39  	 * @return The list of maps from persons to lists of phone numbers.
40  	 */
41  	public MutableList<MutableMap<NatuerlichePerson, MutableList<Telefon>>> getTelefonbuecher() {
42  		return this.eintraege;
43  	}
44  	
45  	/**
46  	 * Adds a map from persons to lists of phone numbers.
47  	 * 
48  	 * @param telefonbuch
49  	 *            A map from persons to lists of phone numbers.
50  	 */
51  	public void addTelefonbuch(final MutableMap<NatuerlichePerson, MutableList<Telefon>> telefonbuch) {
52  		if (!this.eintraege.contains(telefonbuch)) {
53  			this.eintraege.insert(telefonbuch);
54  		}
55  	}
56  }