KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > vo > Forum


1 package org.javabb.vo;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.HashSet JavaDoc;
6 import java.util.Set JavaDoc;
7
8 import org.apache.commons.lang.builder.EqualsBuilder;
9 import org.apache.commons.lang.builder.HashCodeBuilder;
10 import org.apache.commons.lang.builder.ToStringBuilder;
11
12 /*
13  * Copyright 2004 JavaFree.org
14  *
15  * Licensed under the Apache License, Version 2.0 (the "License");
16  * you may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at
18  *
19  * http://www.apache.org/licenses/LICENSE-2.0
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  */

27
28 /**
29  * $Id: Forum.java,v 1.18.2.1.6.2 2006/04/17 17:46:54 daltoncamargo Exp $
30  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
31  * @author Ronald Tetsuo Miura
32  */

33 public class Forum extends VOObject implements Serializable JavaDoc {
34
35     /** nullable persistent field */
36     private String JavaDoc nome;
37
38     /** nullable persistent field */
39     private String JavaDoc descricao;
40
41     /** nullable persistent field */
42     private Integer JavaDoc forumStatus;
43
44     /** persistent field */
45     private Set JavaDoc topics;
46
47     /** Persistent object * */
48     private Integer JavaDoc forumOrder;
49
50     private Long JavaDoc topicCount;
51
52     private Long JavaDoc postCount;
53
54     private Long JavaDoc lastPagePost;
55
56     private String JavaDoc lastPostUserName;
57
58     private Long JavaDoc lastPostUserId;
59
60     private Long JavaDoc lastPostId;
61
62     private Date JavaDoc lastPostDate;
63
64     private Long JavaDoc lastTopicId;
65
66     private Category category;
67     
68     private Set JavaDoc forumTopUsers;
69
70     /** default constructor */
71     public Forum() {
72         // do nothing
73
}
74
75     public Forum(Long JavaDoc id) {
76         setIdForum(id);
77     }
78     
79     /**
80      * @param name
81      * @param description
82      * @param sortingPosition
83      * @param status
84      */

85     public Forum(String JavaDoc name, String JavaDoc description, Integer JavaDoc sortingPosition, Integer JavaDoc status) {
86         this(null, name, description, sortingPosition, status, new HashSet JavaDoc());
87     }
88
89     /**
90      * @param id
91      * @param name
92      * @param description
93      * @param sortingPosition
94      * @param status
95      * @param topics
96      */

97     public Forum(Long JavaDoc id, String JavaDoc name, String JavaDoc description, Integer JavaDoc sortingPosition, Integer JavaDoc status,
98         Set JavaDoc topics) {
99
100         setId(id);
101         setNome(name);
102         setDescricao(description);
103         setForumOrder(sortingPosition);
104         setForumStatus(status);
105         setTopics(topics);
106     }
107
108     /**
109      * @return id
110      */

111     public Long JavaDoc getIdForum() {
112         return getId();
113     }
114
115     /**
116      * @param id
117      */

118     public void setIdForum(Long JavaDoc id) {
119         this.setId(id);
120     }
121
122     /**
123      * TODO
124      * @return name
125      */

126     public String JavaDoc getNome() {
127         return this.nome;
128     }
129
130     /**
131      * @param nome
132      */

133     public void setNome(String JavaDoc nome) {
134         this.nome = nome;
135     }
136
137     /**
138      * TODO
139      * @return descricao
140      */

141     public String JavaDoc getDescricao() {
142         return this.descricao;
143     }
144
145     /**
146      * @param descricao
147      */

148     public void setDescricao(String JavaDoc descricao) {
149         this.descricao = descricao;
150     }
151
152     /**
153      * @return topics
154      */

155     public Set JavaDoc getTopics() {
156         return this.topics;
157     }
158
159     /**
160      * @param topics
161      */

162     public void setTopics(Set JavaDoc topics) {
163         this.topics = topics;
164     }
165
166     /**
167      * @see java.lang.Object#toString()
168      */

169     public String JavaDoc toString() {
170         return new ToStringBuilder(this).append("idForum", getIdForum()).toString();
171     }
172
173     /**
174      * @see java.lang.Object#equals(java.lang.Object)
175      */

176     public boolean equals(Object JavaDoc other) {
177         if (!(other instanceof Forum)) {
178             return false;
179         }
180
181         Forum castOther = (Forum) other;
182
183         return new EqualsBuilder().append(this.getIdForum(), castOther.getIdForum()).isEquals();
184     }
185
186     /**
187      * @see java.lang.Object#hashCode()
188      */

189     public int hashCode() {
190         return new HashCodeBuilder().append(getIdForum()).toHashCode();
191     }
192
193     /**
194      * @return Returns the forumStatus.
195      */

196     public Integer JavaDoc getForumStatus() {
197         return forumStatus;
198     }
199
200     /**
201      * @param forumStatus The forumStatus to set.
202      */

203     public void setForumStatus(Integer JavaDoc forumStatus) {
204         this.forumStatus = forumStatus;
205     }
206
207     /**
208      * @return Returns the forumOrder.
209      */

210     public Integer JavaDoc getForumOrder() {
211         return forumOrder;
212     }
213
214     /**
215      * @param forumOrder The forumOrder to set.
216      */

217     public void setForumOrder(Integer JavaDoc forumOrder) {
218         this.forumOrder = forumOrder;
219     }
220
221     /**
222      * @return Returns the category.
223      */

224     public Category getCategory() {
225         return category;
226     }
227
228     /**
229      * @param category The category to set.
230      */

231     public void setCategory(Category category) {
232         this.category = category;
233     }
234
235     /**
236      * @return Returns the topicCount.
237      */

238     public Long JavaDoc getTopicCount() {
239         return topicCount;
240     }
241
242     /**
243      * @param topicCount The topicCount to set.
244      */

245     public void setTopicCount(Long JavaDoc topicCount) {
246         this.topicCount = topicCount;
247     }
248
249     /**
250      * @return Returns the postCount.
251      */

252     public Long JavaDoc getPostCount() {
253         return postCount;
254     }
255
256     /**
257      * @param postCount The postCount to set.
258      */

259     public void setPostCount(Long JavaDoc postCount) {
260         this.postCount = postCount;
261     }
262
263     /**
264      * @return Returns the lastPagePost.
265      */

266     public Long JavaDoc getLastPagePost() {
267         return lastPagePost;
268     }
269
270     /**
271      * @param lastPagePost The lastPagePost to set.
272      */

273     public void setLastPagePost(Long JavaDoc lastPagePost) {
274         this.lastPagePost = lastPagePost;
275     }
276
277     /**
278      * @return Returns the lastPostId.
279      */

280     public Long JavaDoc getLastPostId() {
281         return lastPostId;
282     }
283
284     /**
285      * @param lastPostId The lastPostId to set.
286      */

287     public void setLastPostId(Long JavaDoc lastPostId) {
288         this.lastPostId = lastPostId;
289     }
290
291     /**
292      * @return Returns the lastPostUserId.
293      */

294     public Long JavaDoc getLastPostUserId() {
295         return lastPostUserId;
296     }
297
298     /**
299      * @param lastPostUserId The lastPostUserId to set.
300      */

301     public void setLastPostUserId(Long JavaDoc lastPostUserId) {
302         this.lastPostUserId = lastPostUserId;
303     }
304
305     /**
306      * @return Returns the lastPostUserName.
307      */

308     public String JavaDoc getLastPostUserName() {
309         return lastPostUserName;
310     }
311
312     /**
313      * @param lastPostUserName The lastPostUserName to set.
314      */

315     public void setLastPostUserName(String JavaDoc lastPostUserName) {
316         this.lastPostUserName = lastPostUserName;
317     }
318
319     /**
320      * @return Returns the lastPostDate.
321      */

322     public Date JavaDoc getLastPostDate() {
323         return lastPostDate;
324     }
325
326     /**
327      * @param lastPostDate The lastPostDate to set.
328      */

329     public void setLastPostDate(Date JavaDoc lastPostDate) {
330         this.lastPostDate = lastPostDate;
331     }
332
333     /**
334      * @return Returns the lastTopicId.
335      */

336     public Long JavaDoc getLastTopicId() {
337         return lastTopicId;
338     }
339
340     /**
341      * @param lastTopicId The lastTopicId to set.
342      */

343     public void setLastTopicId(Long JavaDoc lastTopicId) {
344         this.lastTopicId = lastTopicId;
345     }
346
347     public Set JavaDoc getForumTopUsers() {
348         return forumTopUsers;
349     }
350
351     public void setForumTopUsers(Set JavaDoc forumTopUsers) {
352         this.forumTopUsers = forumTopUsers;
353     }
354 }
355
Popular Tags