1 package org.javabb.vo; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 import java.util.List ; 6 import java.util.Set ; 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 27 28 34 public class Topic extends VOObject implements Serializable { 35 36 private static final long serialVersionUID = 1L; 37 38 39 private String titleTopic; 40 41 private Date dataTopico; 42 43 44 private User user; 45 46 47 private Forum forum; 48 49 50 private Set posts; 51 52 53 private Integer visualizacoes; 54 55 56 private Integer respostas; 57 58 59 private Integer notifyMe; 60 61 62 private Integer topicStatus; 63 64 65 private Integer topicModel; 66 67 68 private Post lastPost; 69 70 71 private Date lastPostDate; 72 73 74 private Integer pageLastPost; 75 76 77 private List pagesPerTopic; 78 79 80 private Long lastPostId; 81 82 83 private String lastPostUserName; 84 85 86 private Long lastPostUserId; 87 88 private Set answerNotifies; 89 90 private Set favUserTopics; 91 92 100 public Topic(Long id, String titleTopic, User user, Forum forum, Set posts) { 101 setId(id); 102 this.titleTopic = titleTopic; 103 this.user = user; 104 this.forum = forum; 105 this.posts = posts; 106 } 107 108 109 public Topic() { 110 } 112 113 public Topic(Long id) { 114 setIdTopic(id); 115 } 116 117 124 public Topic(Long id, User user, Forum forum, Set posts) { 125 setId(id); 126 this.user = user; 127 this.forum = forum; 128 this.posts = posts; 129 } 130 131 134 public Long getIdTopic() { 135 return getId(); 136 } 137 138 141 public void setIdTopic(Long id) { 142 this.setId(id); 143 } 144 145 148 public String getTitleTopic() { 149 return this.titleTopic; 150 } 151 152 155 public void setTitleTopic(String titleTopic) { 156 this.titleTopic = titleTopic; 157 } 158 159 162 public User getUser() { 163 return this.user; 164 } 165 166 169 public void setUser(User user) { 170 this.user = user; 171 } 172 173 176 public Forum getForum() { 177 return this.forum; 178 } 179 180 183 public void setForum(Forum forum) { 184 this.forum = forum; 185 } 186 187 190 public Set getPosts() { 191 return this.posts; 192 } 193 194 197 public void setPosts(Set posts) { 198 this.posts = posts; 199 } 200 201 204 public String toString() { 205 return new ToStringBuilder(this).append("idTopic", getIdTopic()).toString(); 206 } 207 208 211 public boolean equals(Object 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 224 public int hashCode() { 225 return new HashCodeBuilder().append(getIdTopic()).toHashCode(); 226 } 227 228 231 public Date getDataTopico() { 232 return dataTopico; 233 } 234 235 238 public void setDataTopico(Date dataTopico) { 239 this.dataTopico = dataTopico; 240 } 241 242 245 public Integer getVisualizacoes() { 246 return visualizacoes; 247 } 248 249 252 public void setVisualizacoes(Integer visualizacoes) { 253 this.visualizacoes = visualizacoes; 254 } 255 256 259 public Integer getRespostas() { 260 return respostas; 261 } 262 263 266 public void setRespostas(Integer respostas) { 267 this.respostas = respostas; 268 } 269 270 273 public Post getLastPost() { 274 return lastPost; 275 } 276 277 280 public void setLastPost(Post lastPost) { 281 this.lastPost = lastPost; 282 } 283 284 287 public Integer getTopicStatus() { 288 return topicStatus; 289 } 290 291 294 public void setTopicStatus(Integer topicStatus) { 295 this.topicStatus = topicStatus; 296 } 297 298 301 public Integer getPageLastPost() { 302 return pageLastPost; 303 } 304 305 308 public void setPageLastPost(Integer pageLastPost) { 309 this.pageLastPost = pageLastPost; 310 } 311 312 315 public List getPagesPerTopic() { 316 return pagesPerTopic; 317 } 318 319 322 public void setPagesPerTopic(List pagesPerTopic) { 323 this.pagesPerTopic = pagesPerTopic; 324 } 325 326 327 330 public Date getLastPostDate() { 331 return lastPostDate; 332 } 333 336 public void setLastPostDate(Date lastPostDate) { 337 this.lastPostDate = lastPostDate; 338 } 339 340 343 public Long getLastPostId() { 344 return lastPostId; 345 } 346 349 public void setLastPostId(Long lastPostId) { 350 this.lastPostId = lastPostId; 351 } 352 355 public Integer getTopicModel() { 356 return topicModel; 357 } 358 361 public void setTopicModel(Integer topicModel) { 362 this.topicModel = topicModel; 363 } 364 367 public Integer getNotifyMe() { 368 return notifyMe; 369 } 370 373 public void setNotifyMe(Integer notifyMe) { 374 this.notifyMe = notifyMe; 375 } 376 379 public String getLastPostUserName() { 380 return lastPostUserName; 381 } 382 385 public void setLastPostUserName(String lastPostUserName) { 386 this.lastPostUserName = lastPostUserName; 387 } 388 389 392 public Long getLastPostUserId() { 393 return lastPostUserId; 394 } 395 398 public void setLastPostUserId(Long lastPostUserId) { 399 this.lastPostUserId = lastPostUserId; 400 } 401 404 public Set getAnswerNotifies() { 405 return answerNotifies; 406 } 407 410 public void setAnswerNotifies(Set answerNotifies) { 411 this.answerNotifies = answerNotifies; 412 } 413 414 public Set getFavUserTopics() { 415 return favUserTopics; 416 } 417 418 public void setFavUserTopics(Set favUserTopics) { 419 this.favUserTopics = favUserTopics; 420 } 421 } 422 | Popular Tags |