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.model;
19:
20: /**
21: * @author fdietz
22: *
23: */
24: public class BasicModelPartial implements IBasicModelPartial {
25:
26: protected boolean contact;
27:
28: protected String id;
29:
30: protected String name;
31:
32: protected String description;
33:
34: /**
35: * Default constructor
36: *
37: */
38: public BasicModelPartial(boolean contact) {
39: this .contact = contact;
40: }
41:
42: public BasicModelPartial(String id, boolean contact) {
43: if (id == null)
44: throw new IllegalArgumentException("id == null");
45:
46: this .contact = contact;
47: this .id = id;
48: }
49:
50: public BasicModelPartial(String id, String name, boolean contact) {
51: this (id, contact);
52:
53: if (name == null)
54: throw new IllegalArgumentException("name == null");
55:
56: this .name = name;
57: }
58:
59: /**
60: * @return Returns the contact.
61: */
62: public boolean isContact() {
63: return contact;
64: }
65:
66: /**
67: * @see java.lang.Object#toString()
68: */
69: public String toString() {
70: return name;
71: }
72:
73: public String getId() {
74: return id;
75: }
76:
77: public String getName() {
78: return name;
79: }
80:
81: public String getDescription() {
82: return description;
83: }
84:
85: public void setDescription(String description) {
86: this .description = description;
87: }
88:
89: public IBasicModelPartial clone() {
90: IBasicModelPartial p = new BasicModelPartial(id, name, contact);
91: return p;
92: }
93: }
|