1 package org.columba.addressbook.facade; 19 20 24 public class HeaderItem implements IHeaderItem { 25 26 private String id; 27 28 private String name; 29 30 private String description; 31 32 private boolean contact; 33 34 public HeaderItem() { 35 36 } 37 38 public HeaderItem(boolean contact) { 39 this.contact = contact; 40 } 41 42 public HeaderItem(String id, boolean contact) { 43 if (id == null) 44 throw new IllegalArgumentException ("id == null"); 45 46 this.id = id; 47 this.contact = contact; 48 } 49 50 60 public HeaderItem(String id, String name, String description, 61 boolean contact) { 62 this(id, contact); 63 64 if (name == null) 65 throw new IllegalArgumentException ("name == null"); 66 if (description == null) 67 throw new IllegalArgumentException ("description == null"); 68 69 this.name = name; 70 this.description = description; 71 } 72 73 public String getId() { 74 return id; 75 } 76 77 80 public void setId(String id) { 81 this.id = id; 82 } 83 84 public String getName() { 85 return name; 86 } 87 88 public String getDescription() { 89 return description; 90 } 91 92 public boolean isContact() { 93 return contact; 94 } 95 96 public void setName(String name) { 97 this.name = name; 98 } 99 100 public void setDescription(String description) { 101 this.description = description; 102 } 103 104 public Object clone() { 105 IHeaderItem item = null; 106 try { 107 item = (IHeaderItem)super.clone(); 108 } catch (CloneNotSupportedException e) { 109 e.printStackTrace(); 111 } 112 return item; 113 } 114 } 115 | Popular Tags |