01: // The contents of this file are subject to the Mozilla Public License Version
02: // 1.1
03: //(the "License"); you may not use this file except in compliance with the
04: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
05: //
06: //Software distributed under the License is distributed on an "AS IS" basis,
07: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
08: //for the specific language governing rights and
09: //limitations under the License.
10: //
11: //The Original Code is "The Columba Project"
12: //
13: //The Initial Developers of the Original Code are Frederik Dietz and Timo
14: // Stich.
15: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16: //
17: //All Rights Reserved.
18: package org.columba.addressbook.facade;
19:
20: /**
21: * Convenience class implementation of IContactItem. This implementation class can be used by clients
22: * of the addressbook facade if desired, or can be implemented differently, if necessary.
23: */
24: public class ContactItem extends HeaderItem implements IContactItem {
25:
26: private String firstName;
27: private String lastName;
28: private String address;
29:
30: public ContactItem() {
31: super (true);
32: }
33:
34: public ContactItem(String id) {
35: super (id, true);
36: }
37:
38: /**
39: *
40: * @param id unique id as generated by the contact store
41: * @param name display name, as seen as "Sort as" in the contact editor dialog
42: * @param firstName optional firstName, can be <code>null</code>
43: * @param lastName optional lastName, can be <code>null</code>
44: * @param address email address
45: */
46: public ContactItem(String id, String name, String firstName,
47: String lastName, String address) {
48: super (id, true);
49:
50: if (name == null)
51: throw new IllegalArgumentException("name == null");
52: if (address == null)
53: throw new IllegalArgumentException("address == null");
54:
55: this .firstName = firstName;
56: this .lastName = lastName;
57: this .address = address;
58:
59: setName(name);
60:
61: }
62:
63: public String getFirstName() {
64: return firstName;
65: }
66:
67: public String getLastName() {
68: return lastName;
69: }
70:
71: public String getEmailAddress() {
72: return address;
73: }
74:
75: public void setFirstName(String firstName) {
76: this .firstName = firstName;
77: }
78:
79: public void setLastName(String lastName) {
80: this .lastName = lastName;
81: }
82:
83: public void setEmailAddress(String emailAddress) {
84: this.address = emailAddress;
85: }
86: }
|