1 18 package org.apache.roller.pojos; 19 20 import java.sql.Timestamp ; 21 import org.apache.roller.util.PojoUtil; 22 23 33 public class CommentData extends org.apache.roller.pojos.PersistentObject 34 implements java.io.Serializable { 35 public static final long serialVersionUID = -6668122596726478462L; 36 37 private String id = null; 38 private String name = null; 39 private String email = null; 40 private String url = null; 41 private String content = null; 42 private Timestamp postTime = null; 43 private Boolean spam = Boolean.FALSE; 44 private Boolean notify = Boolean.FALSE; 45 private String remoteHost = null; 46 private Boolean pending = null; 47 private Boolean approved = null; 48 private WeblogEntryData weblogEntry = null; 49 50 51 public CommentData() { 52 spam = Boolean.FALSE; 53 } 54 55 public CommentData(java.lang.String id, WeblogEntryData entry, 56 java.lang.String name, java.lang.String email, 57 java.lang.String url, java.lang.String content, 58 java.sql.Timestamp postTime, 59 Boolean spam, Boolean notify, 60 Boolean pending, Boolean approved) { 61 this.id = id; 62 this.name = name; 63 this.email = email; 64 this.url = url; 65 this.content = content; 66 this.postTime = postTime; 67 this.spam = spam; 68 this.notify = notify; 69 this.pending = pending; 70 this.approved = approved; 71 72 weblogEntry = entry; 73 } 74 75 public CommentData(CommentData otherData) { 76 this.setData(otherData); 77 } 78 79 85 public java.lang.String getId() { 86 return this.id; 87 } 88 89 90 public void setId(java.lang.String id) { 91 this.id = id; 92 } 93 94 99 public WeblogEntryData getWeblogEntry() { 100 return weblogEntry; 101 } 102 103 104 public void setWeblogEntry(WeblogEntryData entry) { 105 weblogEntry = entry; 106 } 107 108 113 public java.lang.String getName() { 114 return this.name; 115 } 116 117 118 public void setName(java.lang.String name) { 119 this.name = name; 120 } 121 122 129 public java.lang.String getEmail() { 130 return this.email; 131 } 132 133 134 public void setEmail(java.lang.String email) { 135 this.email = email; 136 } 137 138 143 public java.lang.String getUrl() { 144 return this.url; 145 } 146 147 148 public void setUrl(java.lang.String url) { 149 this.url = url; 150 } 151 152 157 public java.lang.String getContent() { 158 return this.content; 159 } 160 161 162 public void setContent(java.lang.String content) { 163 this.content = content; 164 } 165 166 171 public java.sql.Timestamp getPostTime() { 172 return this.postTime; 173 } 174 175 176 public void setPostTime(java.sql.Timestamp postTime) { 177 this.postTime = postTime; 178 } 179 180 185 public Boolean getSpam() { 186 return this.spam; 187 } 188 189 190 public void setSpam(Boolean spam) { 191 this.spam = spam; 192 } 193 194 199 public Boolean getNotify() { 200 return this.notify; 201 } 202 203 204 public void setNotify(Boolean notify) { 205 this.notify = notify; 206 } 207 208 213 public Boolean getPending() { 214 return this.pending; 215 } 216 217 218 public void setPending(Boolean pending) { 219 this.pending = pending; 220 } 221 222 227 public Boolean getApproved() { 228 return this.approved; 229 } 230 231 232 public void setApproved(Boolean approved) { 233 this.approved = approved; 234 } 235 236 239 public void setRemoteHost(String remoteHost) { 240 this.remoteHost = remoteHost; 241 } 242 243 248 public String getRemoteHost() { 249 return this.remoteHost; 250 } 251 252 public String toString() { 253 StringBuffer str = new StringBuffer ("{"); 254 255 str.append("id=" + id + " " + 256 "name=" + name + " " + 257 "email=" + email + " " + 258 "url=" + url + " " + 259 "content=" + content + " " + 260 "postTime=" + postTime + " " + 261 "spam=" + spam + 262 "notify=" + notify + 263 "pending" + pending + 264 "approved" + approved); 265 str.append('}'); 266 267 return (str.toString()); 268 } 269 270 public boolean equals(Object pOther) { 271 if (pOther instanceof CommentData) { 272 CommentData lTest = (CommentData) pOther; 273 boolean lEquals = true; 274 275 lEquals = PojoUtil.equals(lEquals, this.id, lTest.getId()); 276 lEquals = PojoUtil.equals(lEquals, this.weblogEntry, lTest.getWeblogEntry()); 277 lEquals = PojoUtil.equals(lEquals, this.name, lTest.getName()); 278 lEquals = PojoUtil.equals(lEquals, this.email, lTest.getEmail()); 279 lEquals = PojoUtil.equals(lEquals, this.url, lTest.getUrl()); 280 lEquals = PojoUtil.equals(lEquals, this.content, lTest.getContent()); 281 lEquals = PojoUtil.equals(lEquals, this.postTime, lTest.getPostTime()); 282 lEquals = PojoUtil.equals(lEquals, this.spam, lTest.getSpam()); 283 lEquals = PojoUtil.equals(lEquals, this.notify, lTest.getNotify()); 284 lEquals = PojoUtil.equals(lEquals, this.pending, lTest.getPending()); 285 lEquals = PojoUtil.equals(lEquals, this.approved, lTest.getApproved()); 286 return lEquals; 287 } else { 288 return false; 289 } 290 } 291 292 public int hashCode() { 293 int result = 17; 294 result = PojoUtil.addHashCode(result, this.id); 295 result = PojoUtil.addHashCode(result, this.weblogEntry); 296 result = PojoUtil.addHashCode(result, this.name); 297 result = PojoUtil.addHashCode(result, this.email); 298 result = PojoUtil.addHashCode(result, this.url); 299 result = PojoUtil.addHashCode(result, this.content); 300 result = PojoUtil.addHashCode(result, this.postTime); 301 result = PojoUtil.addHashCode(result, this.spam); 302 result = PojoUtil.addHashCode(result, this.notify); 303 result = PojoUtil.addHashCode(result, this.pending); 304 result = PojoUtil.addHashCode(result, this.approved); 305 306 return result; 307 } 308 309 312 public void setData(org.apache.roller.pojos.PersistentObject otherData) { 313 CommentData otherComment = (CommentData) otherData; 314 315 this.id = otherComment.getId(); 316 this.weblogEntry = otherComment.getWeblogEntry(); 317 this.name = otherComment.getName(); 318 this.email = otherComment.getEmail(); 319 this.url = otherComment.getUrl(); 320 this.content = otherComment.getContent(); 321 this.postTime = otherComment.getPostTime(); 322 this.spam = otherComment.getSpam(); 323 this.notify = otherComment.getNotify(); 324 this.pending = otherComment.getPending(); 325 this.approved = otherComment.getApproved(); 326 } 327 328 332 public String getTimestamp() { 333 if (postTime != null) { 334 return Long.toString(postTime.getTime()); 335 } 336 return null; 337 } 338 339 340 public void setTimestamp(String timeStamp) {} 341 } | Popular Tags |