KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.javabb.vo;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.List 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: Topic.java,v 1.19.8.3 2006/08/01 22:30:40 daltoncamargo Exp $
30  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
31  * @author Lucas Frare Teixeira - <a HREF="mailto:lucas@javabb.org">lucas@javabb.org </a> <br>
32  * @author Ronald Tetsuo Miura
33  */

34 public class Topic extends VOObject implements Serializable JavaDoc {
35
36     private static final long serialVersionUID = 1L;
37
38     /** nullable persistent field */
39     private String JavaDoc titleTopic;
40
41     private Date JavaDoc dataTopico;
42
43     /** persistent field */
44     private User user;
45
46     /** persistent field */
47     private Forum forum;
48
49     /** persistent field */
50     private Set JavaDoc posts;
51
52     /** nullable persistent field */
53     private Integer JavaDoc visualizacoes;
54
55     /** nullable persistent field */
56     private Integer JavaDoc respostas;
57
58     /** nullable persistent field */
59     private Integer JavaDoc notifyMe;
60     
61     /** nullable persistent field */
62     private Integer JavaDoc topicStatus;
63
64     /** nullable persistent field */
65     private Integer JavaDoc topicModel;
66     
67     /** No persistent object * */
68     private Post lastPost;
69
70     /** nullable persistent field */
71     private Date JavaDoc lastPostDate;
72
73     /** Persistent object * */
74     private Integer JavaDoc pageLastPost;
75
76     /** No persistent object * */
77     private List JavaDoc pagesPerTopic;
78
79     /** nullable persistent field */
80     private Long JavaDoc lastPostId;
81
82     /** nullable persistent field */
83     private String JavaDoc lastPostUserName;
84
85     /** nullable persistent field */
86     private Long JavaDoc lastPostUserId;
87
88     private Set JavaDoc answerNotifies;
89     
90     private Set JavaDoc favUserTopics;
91     
92     /**
93      * full constructor
94      * @param id
95      * @param titleTopic
96      * @param usersPortal
97      * @param forum
98      * @param posts
99      */

100     public Topic(Long JavaDoc id, String JavaDoc titleTopic, User user, Forum forum, Set JavaDoc posts) {
101         setId(id);
102         this.titleTopic = titleTopic;
103         this.user = user;
104         this.forum = forum;
105         this.posts = posts;
106     }
107
108     /** default constructor */
109     public Topic() {
110         // do nothing...
111
}
112
113     public Topic(Long JavaDoc id) {
114         setIdTopic(id);
115     }
116     
117     /**
118      * minimal constructor.
119      * @param id
120      * @param usersPortal
121      * @param forum
122      * @param posts
123      */

124     public Topic(Long JavaDoc id, User user, Forum forum, Set JavaDoc posts) {
125         setId(id);
126         this.user = user;
127         this.forum = forum;
128         this.posts = posts;
129     }
130
131     /**
132      * @return id
133      */

134     public Long JavaDoc getIdTopic() {
135         return getId();
136     }
137
138     /**
139      * @param id
140      */

141     public void setIdTopic(Long JavaDoc id) {
142         this.setId(id);
143     }
144
145     /**
146      * @return title
147      */

148     public String JavaDoc getTitleTopic() {
149         return this.titleTopic;
150     }
151
152     /**
153      * @param titleTopic
154      */

155     public void setTitleTopic(String JavaDoc titleTopic) {
156         this.titleTopic = titleTopic;
157     }
158
159     /**
160      * @return user
161      */

162     public User getUser() {
163         return this.user;
164     }
165
166     /**
167      * @param usersPortal
168      */

169     public void setUser(User user) {
170         this.user = user;
171     }
172
173     /**
174      * @return forum
175      */

176     public Forum getForum() {
177         return this.forum;
178     }
179
180     /**
181      * @param forum
182      */

183     public void setForum(Forum forum) {
184         this.forum = forum;
185     }
186
187     /**
188      * @return posts
189      */

190     public Set JavaDoc getPosts() {
191         return this.posts;
192     }
193
194     /**
195      * @param posts
196      */

197     public void setPosts(Set JavaDoc posts) {
198         this.posts = posts;
199     }
200
201     /**
202      * @see java.lang.Object#toString()
203      */

204     public String JavaDoc toString() {
205         return new ToStringBuilder(this).append("idTopic", getIdTopic()).toString();
206     }
207
208     /**
209      * @see java.lang.Object#equals(java.lang.Object)
210      */

211     public boolean equals(Object JavaDoc other) {
212         if (!(other instanceof Topic)) {
213             return false;
214         }
215
216         Topic castOther = (Topic) other;
217
218         return new EqualsBuilder().append(this.getIdTopic(), castOther.getIdTopic()).isEquals();
219     }
220
221     /**
222      * @see java.lang.Object#hashCode()
223      */

224     public int hashCode() {
225         return new HashCodeBuilder().append(getIdTopic()).toHashCode();
226     }
227
228     /**
229      * @return Returns the dataTopico.
230      */

231     public Date JavaDoc getDataTopico() {
232         return dataTopico;
233     }
234
235     /**
236      * @param dataTopico The dataTopico to set.
237      */

238     public void setDataTopico(Date JavaDoc dataTopico) {
239         this.dataTopico = dataTopico;
240     }
241
242     /**
243      * @return Returns the visualizacoes.
244      */

245     public Integer JavaDoc getVisualizacoes() {
246         return visualizacoes;
247     }
248
249     /**
250      * @param visualizacoes The visualizacoes to set.
251      */

252     public void setVisualizacoes(Integer JavaDoc visualizacoes) {
253         this.visualizacoes = visualizacoes;
254     }
255
256     /**
257      * @return Returns the respostas.
258      */

259     public Integer JavaDoc getRespostas() {
260         return respostas;
261     }
262
263     /**
264      * @param respostas The respostas to set.
265      */

266     public void setRespostas(Integer JavaDoc respostas) {
267         this.respostas = respostas;
268     }
269
270     /**
271      * @return Returns the lastPost.
272      */

273     public Post getLastPost() {
274         return lastPost;
275     }
276
277     /**
278      * @param lastPost The lastPost to set.
279      */

280     public void setLastPost(Post lastPost) {
281         this.lastPost = lastPost;
282     }
283
284     /**
285      * @return Returns the topicStatus.
286      */

287     public Integer JavaDoc getTopicStatus() {
288         return topicStatus;
289     }
290
291     /**
292      * @param topicStatus The topicStatus to set.
293      */

294     public void setTopicStatus(Integer JavaDoc topicStatus) {
295         this.topicStatus = topicStatus;
296     }
297
298     /**
299      * @return Returns the pageLastPost.
300      */

301     public Integer JavaDoc getPageLastPost() {
302         return pageLastPost;
303     }
304
305     /**
306      * @param pageLastPost The pageLastPost to set.
307      */

308     public void setPageLastPost(Integer JavaDoc pageLastPost) {
309         this.pageLastPost = pageLastPost;
310     }
311
312     /**
313      * @return Returns the pagesPerTopic.
314      */

315     public List JavaDoc getPagesPerTopic() {
316         return pagesPerTopic;
317     }
318
319     /**
320      * @param pagesPerTopic The pagesPerTopic to set.
321      */

322     public void setPagesPerTopic(List JavaDoc pagesPerTopic) {
323         this.pagesPerTopic = pagesPerTopic;
324     }
325
326
327     /**
328      * @return Returns the lastPostDate.
329      */

330     public Date JavaDoc getLastPostDate() {
331         return lastPostDate;
332     }
333     /**
334      * @param lastPostDate The lastPostDate to set.
335      */

336     public void setLastPostDate(Date JavaDoc lastPostDate) {
337         this.lastPostDate = lastPostDate;
338     }
339
340     /**
341      * @return Returns the lastPostId.
342      */

343     public Long JavaDoc getLastPostId() {
344         return lastPostId;
345     }
346     /**
347      * @param lastPostId The lastPostId to set.
348      */

349     public void setLastPostId(Long JavaDoc lastPostId) {
350         this.lastPostId = lastPostId;
351     }
352     /**
353      * @return Returns the topicModel.
354      */

355     public Integer JavaDoc getTopicModel() {
356         return topicModel;
357     }
358     /**
359      * @param topicModel The topicModel to set.
360      */

361     public void setTopicModel(Integer JavaDoc topicModel) {
362         this.topicModel = topicModel;
363     }
364     /**
365      * @return Returns the notifyMe.
366      */

367     public Integer JavaDoc getNotifyMe() {
368         return notifyMe;
369     }
370     /**
371      * @param notifyMe The notifyMe to set.
372      */

373     public void setNotifyMe(Integer JavaDoc notifyMe) {
374         this.notifyMe = notifyMe;
375     }
376     /**
377      * @return Returns the lastPostUserName.
378      */

379     public String JavaDoc getLastPostUserName() {
380         return lastPostUserName;
381     }
382     /**
383      * @param lastPostUserName The lastPostUserName to set.
384      */

385     public void setLastPostUserName(String JavaDoc lastPostUserName) {
386         this.lastPostUserName = lastPostUserName;
387     }
388   
389     /**
390      * @return Returns the lastPostUserId.
391      */

392     public Long JavaDoc getLastPostUserId() {
393         return lastPostUserId;
394     }
395     /**
396      * @param lastPostUserId The lastPostUserId to set.
397      */

398     public void setLastPostUserId(Long JavaDoc lastPostUserId) {
399         this.lastPostUserId = lastPostUserId;
400     }
401     /**
402      * @return Returns the answerNotifies.
403      */

404     public Set JavaDoc getAnswerNotifies() {
405         return answerNotifies;
406     }
407     /**
408      * @param answerNotifies The answerNotifies to set.
409      */

410     public void setAnswerNotifies(Set JavaDoc answerNotifies) {
411         this.answerNotifies = answerNotifies;
412     }
413
414     public Set JavaDoc getFavUserTopics() {
415         return favUserTopics;
416     }
417
418     public void setFavUserTopics(Set JavaDoc favUserTopics) {
419         this.favUserTopics = favUserTopics;
420     }
421 }
422
Popular Tags