4 * Copyright (C) 2001, 2002, 2003 The Mir-coders group
6 * This file is part of Mir.
8 * Mir is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * Mir is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Mir; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * In addition, as a special exception, The Mir-coders gives permission to link
23 * the code of this program with any library licensed under the Apache Software License,
24 * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
25 * (or with modified versions of the above that use the same license as the above),
26 * and distribute linked combinations including the two. You must obey the
27 * GNU General Public License in all respects for all of the code used other than
28 * the above mentioned libraries. If you modify this file, you may extend this
29 * exception to your version of the file, but you are not obligated to do so.
30 * If you do not wish to do so, delete this exception statement from your version.
32 package mir.core.model;
34 import java.io.Serializable;
35 import java.util.Date;
37 import org.apache.commons.lang.builder.EqualsBuilder;
38 import org.apache.commons.lang.builder.HashCodeBuilder;
39 import org.apache.commons.lang.builder.ToStringBuilder;
45 * @version $Id: Comment.java,v 1.4 2003/12/20 20:27:09 idfx Exp $
47 public class Comment implements Serializable, IComment {
49 /** identifier field */
52 /** persistent field */
55 /** persistent field */
56 private String creator;
58 /** persistent field */
59 private String description;
61 /** nullable persistent field */
62 private String mainUrl;
64 /** nullable persistent field */
67 /** nullable persistent field */
68 private String address;
70 /** nullable persistent field */
73 /** persistent field */
74 private Date webdbCreate;
76 /** persistent field */
77 private boolean isPublished;
79 /** persistent field */
80 private Language language;
82 /** persistent field */
85 /** nullable persistent field */
86 private CommentStatus commentStatus;
88 /** nullable persistent field */
91 /** persistent field */
92 private boolean isHtml;
94 /** default constructor */
98 public java.lang.Integer getId() {
102 public void setId(java.lang.Integer id) {
106 public java.lang.String getTitle() {
110 public void setTitle(java.lang.String title) {
114 public java.lang.String getCreator() {
118 public void setCreator(java.lang.String creator) {
119 this.creator = creator;
122 public java.lang.String getDescription() {
123 return this.description;
126 public void setDescription(java.lang.String description) {
127 this.description = description;
130 public java.lang.String getMainUrl() {
134 public void setMainUrl(java.lang.String mainUrl) {
135 this.mainUrl = mainUrl;
138 public java.lang.String getEmail() {
142 public void setEmail(java.lang.String email) {
146 public java.lang.String getAddress() {
150 public void setAddress(java.lang.String address) {
151 this.address = address;
154 public java.lang.String getPhone() {
158 public void setPhone(java.lang.String phone) {
162 public java.util.Date getWebdbCreate() {
163 return this.webdbCreate;
166 public void setWebdbCreate(java.util.Date webdbCreate) {
167 this.webdbCreate = webdbCreate;
170 public boolean isPublished() {
171 return this.isPublished;
174 public void setPublished(boolean isPublished) {
175 this.isPublished = isPublished;
178 public int getChecksum() {
179 return this.checksum;
182 public void setChecksum(int checksum) {
183 this.checksum = checksum;
186 public boolean isHtml() {
190 public void setHtml(boolean isHtml) {
191 this.isHtml = isHtml;
196 public CommentStatus getCommentStatus() {
197 return commentStatus;
203 public Language getLanguage() {
210 public Media getMedia() {
217 public void setCommentStatus(CommentStatus status) {
218 commentStatus = status;
224 public void setLanguage(Language language) {
225 this.language = language;
231 public void setMedia(Media media) {
235 public String toString() {
236 return new ToStringBuilder(this).append("id", getId()).toString();
239 public boolean equals(Object other) {
240 if (!(other instanceof Comment))
242 Comment castOther = (Comment) other;
243 return new EqualsBuilder()
244 .append(this.getId(), castOther.getId())
248 public int hashCode() {
249 return new HashCodeBuilder().append(getId()).toHashCode();