1 package org.roller.pojos; 2 3 import org.roller.util.PojoUtil; 4 5 15 public class CommentData extends org.roller.pojos.PersistentObject 16 implements java.io.Serializable 17 { 18 static final long serialVersionUID = -6668122596726478462L; 19 protected java.lang.String id; 20 protected java.lang.String name; 21 protected java.lang.String email; 22 protected java.lang.String url; 23 protected java.lang.String content; 24 protected java.sql.Timestamp postTime; 25 protected WeblogEntryData mWeblogEntry; 26 protected Boolean spam; 27 protected Boolean notify; 28 protected String remoteHost; 29 30 public CommentData() 31 { 32 spam = Boolean.FALSE; 33 } 34 35 public CommentData(java.lang.String id, WeblogEntryData entry, 36 java.lang.String name, java.lang.String email, 37 java.lang.String url, java.lang.String content, 38 java.sql.Timestamp postTime, 39 Boolean spam, Boolean notify) 40 { 41 this.id = id; 42 this.name = name; 43 this.email = email; 44 this.url = url; 45 this.content = content; 46 this.postTime = postTime; 47 this.spam = spam; 48 this.notify = notify; 49 50 mWeblogEntry = entry; 51 } 52 53 public CommentData(CommentData otherData) 54 { 55 this.id = otherData.id; 56 this.name = otherData.name; 57 this.email = otherData.email; 58 this.url = otherData.url; 59 this.content = otherData.content; 60 this.postTime = otherData.postTime; 61 this.spam = otherData.spam; 62 this.notify = otherData.notify; 63 64 mWeblogEntry = otherData.mWeblogEntry; 65 } 66 67 72 public java.lang.String getId() 73 { 74 return this.id; 75 } 76 77 78 public void setId(java.lang.String id) 79 { 80 this.id = id; 81 } 82 83 87 public WeblogEntryData getWeblogEntry() 88 { 89 return mWeblogEntry; 90 } 91 92 93 public void setWeblogEntry(WeblogEntryData entry) 94 { 95 mWeblogEntry = entry; 96 } 97 98 102 public java.lang.String getName() 103 { 104 return this.name; 105 } 106 107 108 public void setName(java.lang.String name) 109 { 110 this.name = name; 111 } 112 113 118 public java.lang.String getEmail() 119 { 120 return this.email; 121 } 122 123 124 public void setEmail(java.lang.String email) 125 { 126 this.email = email; 127 } 128 129 133 public java.lang.String getUrl() 134 { 135 return this.url; 136 } 137 138 139 public void setUrl(java.lang.String url) 140 { 141 this.url = url; 142 } 143 144 148 public java.lang.String getContent() 149 { 150 return this.content; 151 } 152 153 154 public void setContent(java.lang.String content) 155 { 156 this.content = content; 157 } 158 159 163 public java.sql.Timestamp getPostTime() 164 { 165 return this.postTime; 166 } 167 168 169 public void setPostTime(java.sql.Timestamp postTime) 170 { 171 this.postTime = postTime; 172 } 173 174 178 public Boolean getSpam() 179 { 180 return this.spam; 181 } 182 183 184 public void setSpam(Boolean spam) 185 { 186 this.spam = spam; 187 } 188 189 193 public Boolean getNotify() 194 { 195 return this.notify; 196 } 197 198 199 public void setNotify(Boolean notify) 200 { 201 this.notify = notify; 202 } 203 204 207 public void setRemoteHost(String remoteHost) { 208 this.remoteHost = remoteHost; 209 } 210 211 215 public String getRemoteHost() { 216 return this.remoteHost; 217 } 218 219 public String toString() 220 { 221 StringBuffer str = new StringBuffer ("{"); 222 223 str.append("id=" + id + " " + 224 "name=" + name + " " + 225 "email=" + email + " " + 226 "url=" + url + " " + 227 "content=" + content + " " + 228 "postTime=" + postTime + " " + 229 "spam=" + spam + 230 "notify=" + notify); 231 str.append('}'); 232 233 return (str.toString()); 234 } 235 236 public boolean equals(Object pOther) 237 { 238 if (pOther instanceof CommentData) 239 { 240 CommentData lTest = (CommentData) pOther; 241 boolean lEquals = true; 242 243 lEquals = PojoUtil.equals(lEquals, this.id, lTest.id); 244 lEquals = PojoUtil.equals(lEquals, this.mWeblogEntry, lTest.mWeblogEntry); 245 lEquals = PojoUtil.equals(lEquals, this.name, lTest.name); 246 lEquals = PojoUtil.equals(lEquals, this.email, lTest.email); 247 lEquals = PojoUtil.equals(lEquals, this.url, lTest.url); 248 lEquals = PojoUtil.equals(lEquals, this.content, lTest.content); 249 lEquals = PojoUtil.equals(lEquals, this.postTime, lTest.postTime); 250 lEquals = PojoUtil.equals(lEquals, this.spam, lTest.spam); 251 lEquals = PojoUtil.equals(lEquals, this.notify, lTest.notify); 252 253 return lEquals; 254 } 255 else 256 { 257 return false; 258 } 259 } 260 261 public int hashCode() 262 { 263 int result = 17; 264 result = PojoUtil.addHashCode(result, this.id); 265 result = PojoUtil.addHashCode(result, this.mWeblogEntry); 266 result = PojoUtil.addHashCode(result, this.name); 267 result = PojoUtil.addHashCode(result, this.email); 268 result = PojoUtil.addHashCode(result, this.url); 269 result = PojoUtil.addHashCode(result, this.content); 270 result = PojoUtil.addHashCode(result, this.postTime); 271 result = PojoUtil.addHashCode(result, this.spam); 272 result = PojoUtil.addHashCode(result, this.notify); 273 274 return result; 275 } 276 277 280 public void setData(org.roller.pojos.PersistentObject otherData) 281 { 282 CommentData otherComment = (CommentData) otherData; 283 this.id = otherComment.id; 284 this.mWeblogEntry = otherComment.mWeblogEntry; 285 this.name = otherComment.name; 286 this.email = otherComment.email; 287 this.url = otherComment.url; 288 this.content = otherComment.content; 289 this.postTime = otherComment.postTime; 290 this.spam = otherComment.spam; 291 this.notify = otherComment.notify; 292 } 293 294 } | Popular Tags |