working on struts/hibernate for content-admin
[mir.git] / source / mir / core / model / Comment.java
1 /*
2  * Comment.java
3  * 
4  * Copyright (C) 2001, 2002, 2003 The Mir-coders group
5  *
6  * This file is part of Mir.
7  *
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.
12  *
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.
17  *
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
21  *
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.
31  */
32 package mir.core.model;
33
34 import java.io.Serializable;
35 import java.util.Date;
36
37 import org.apache.commons.lang.builder.EqualsBuilder;
38 import org.apache.commons.lang.builder.HashCodeBuilder;
39 import org.apache.commons.lang.builder.ToStringBuilder;
40
41 /**
42  * 
43  * Comment
44  * @author idefix
45  * @version $Id: Comment.java,v 1.4 2003/12/20 20:27:09 idfx Exp $
46  */
47 public class Comment implements Serializable, IComment {
48
49         /** identifier field */
50         private Integer id;
51
52         /** persistent field */
53         private String title;
54
55         /** persistent field */
56         private String creator;
57
58         /** persistent field */
59         private String description;
60
61         /** nullable persistent field */
62         private String mainUrl;
63
64         /** nullable persistent field */
65         private String email;
66
67         /** nullable persistent field */
68         private String address;
69
70         /** nullable persistent field */
71         private String phone;
72
73         /** persistent field */
74         private Date webdbCreate;
75
76         /** persistent field */
77         private boolean isPublished;
78
79         /** persistent field */
80         private Language language;
81
82         /** persistent field */
83         private Media media;
84
85         /** nullable persistent field */
86         private CommentStatus commentStatus;
87
88         /** nullable persistent field */
89         private int checksum;
90
91         /** persistent field */
92         private boolean isHtml;
93
94         /** default constructor */
95         public Comment() {
96         }
97
98         public java.lang.Integer getId() {
99                 return this.id;
100         }
101
102         public void setId(java.lang.Integer id) {
103                 this.id = id;
104         }
105
106         public java.lang.String getTitle() {
107                 return this.title;
108         }
109
110         public void setTitle(java.lang.String title) {
111                 this.title = title;
112         }
113
114         public java.lang.String getCreator() {
115                 return this.creator;
116         }
117
118         public void setCreator(java.lang.String creator) {
119                 this.creator = creator;
120         }
121
122         public java.lang.String getDescription() {
123                 return this.description;
124         }
125
126         public void setDescription(java.lang.String description) {
127                 this.description = description;
128         }
129
130         public java.lang.String getMainUrl() {
131                 return this.mainUrl;
132         }
133
134         public void setMainUrl(java.lang.String mainUrl) {
135                 this.mainUrl = mainUrl;
136         }
137
138         public java.lang.String getEmail() {
139                 return this.email;
140         }
141
142         public void setEmail(java.lang.String email) {
143                 this.email = email;
144         }
145
146         public java.lang.String getAddress() {
147                 return this.address;
148         }
149
150         public void setAddress(java.lang.String address) {
151                 this.address = address;
152         }
153
154         public java.lang.String getPhone() {
155                 return this.phone;
156         }
157
158         public void setPhone(java.lang.String phone) {
159                 this.phone = phone;
160         }
161
162         public java.util.Date getWebdbCreate() {
163                 return this.webdbCreate;
164         }
165
166         public void setWebdbCreate(java.util.Date webdbCreate) {
167                 this.webdbCreate = webdbCreate;
168         }
169
170         public boolean isPublished() {
171                 return this.isPublished;
172         }
173
174         public void setPublished(boolean isPublished) {
175                 this.isPublished = isPublished;
176         }
177
178         public int getChecksum() {
179                 return this.checksum;
180         }
181
182         public void setChecksum(int checksum) {
183                 this.checksum = checksum;
184         }
185
186         public boolean isHtml() {
187                 return this.isHtml;
188         }
189
190         public void setHtml(boolean isHtml) {
191                 this.isHtml = isHtml;
192         }
193         /**
194          * @return
195          */
196         public CommentStatus getCommentStatus() {
197                 return commentStatus;
198         }
199
200         /**
201          * @return
202          */
203         public Language getLanguage() {
204                 return language;
205         }
206
207         /**
208          * @return
209          */
210         public Media getMedia() {
211                 return media;
212         }
213
214         /**
215          * @param status
216          */
217         public void setCommentStatus(CommentStatus status) {
218                 commentStatus = status;
219         }
220
221         /**
222          * @param language
223          */
224         public void setLanguage(Language language) {
225                 this.language = language;
226         }
227
228         /**
229          * @param media
230          */
231         public void setMedia(Media media) {
232                 this.media = media;
233         }
234         
235         public String toString() {
236                 return new ToStringBuilder(this).append("id", getId()).toString();
237         }
238
239         public boolean equals(Object other) {
240                 if (!(other instanceof Comment))
241                         return false;
242                 Comment castOther = (Comment) other;
243                 return new EqualsBuilder()
244                         .append(this.getId(), castOther.getId())
245                         .isEquals();
246         }
247
248         public int hashCode() {
249                 return new HashCodeBuilder().append(getId()).toHashCode();
250         }
251
252 }