1 package org.javabb.vo; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 import java.util.Set ; 6 7 import org.apache.commons.lang.builder.HashCodeBuilder; 8 import org.apache.commons.lang.builder.ToStringBuilder; 9 import org.javabb.bbcode.ProcessBBCode; 10 11 26 27 32 public class User extends VOObject implements Serializable { 33 34 private static final long serialVersionUID = 1L; 35 36 37 private String user; 38 39 40 private String passwordHash; 41 42 43 private String name; 44 45 46 private String email; 47 48 49 private Long user_posts; 50 51 private Integer admin; 52 53 private Date dataRegistro; 54 55 56 private Set posts; 57 58 59 private Set topics; 60 61 62 private String localizacao; 63 64 65 private String website; 66 67 68 private String occupation; 69 70 71 private String userSig; 72 73 74 private String user_avatar; 75 76 77 private String user_icq; 78 79 80 private String user_interests; 81 82 83 private String user_sig; 84 85 86 private String user_aim; 87 88 89 private String user_yim; 90 91 92 private String user_msnm; 93 94 95 private Date _lastVisitTimestamp; 96 97 98 private Date user_lastvisit; 99 100 101 private String user_dateformat; 102 103 104 private String user_allow_viewonline; 105 106 107 private String hash_fpwd; 108 109 110 private Integer show_mail; 111 112 113 private Integer show_signature; 114 115 116 private Integer userStatus; 117 118 119 private String userCode; 120 121 private Set forumTopUsers; 122 123 private ProcessBBCode postFormatter = new ProcessBBCode(); 125 126 private Set answerNotifies; 127 128 private Set favUserTopics; 129 130 140 public User(Long id, String user, String passwordHash, String name, String email, 141 Long user_posts, Set posts, Set topics) { 142 setId(id); 143 this.user = user; 144 this.passwordHash = passwordHash; 145 this.name = name; 146 this.email = email; 147 this.posts = posts; 148 this.posts = posts; 149 this.topics = topics; 150 this.user_posts = user_posts; 151 } 152 153 156 public User() { 157 } 159 160 165 public User(Long id, Set posts, Set topics) { 166 setId(id); 167 this.posts = posts; 168 this.topics = topics; 169 } 170 171 174 public User(Long id) { 175 setId(id); 176 } 177 178 181 public Long getIdUser() { 182 return getId(); 183 } 184 185 188 public void setIdUser(Long idUser) { 189 this.setId(idUser); 190 } 191 192 195 public String getUser() { 196 return this.user; 197 } 198 199 202 public void setUser(String user) { 203 this.user = user; 204 } 205 206 209 public String getPasswordHash() { 210 return this.passwordHash; 211 } 212 213 216 public void setPasswordHash(String passwordHash) { 217 this.passwordHash = passwordHash; 218 } 219 220 223 public String getName() { 224 return this.name; 225 } 226 227 230 public void setName(String name) { 231 this.name = name; 232 } 233 234 237 public String getEmail() { 238 return this.email; 239 } 240 241 244 public void setEmail(String email) { 245 this.email = email; 246 } 247 248 251 public Set getPosts() { 252 return this.posts; 253 } 254 255 258 public void setPosts(Set posts) { 259 this.posts = posts; 260 } 261 262 265 public Set getTopics() { 266 return this.topics; 267 } 268 269 272 public void setTopics(Set topics) { 273 this.topics = topics; 274 } 275 276 279 public String toString() { 280 return new ToStringBuilder(this).append("idUser", getIdUser()).toString(); 281 } 282 283 286 public boolean equals(Object other) { 287 if (!(other instanceof User)) { 288 return false; 289 } 290 291 User castOther = (User) other; 292 293 if(this.getIdUser().longValue() == castOther.getIdUser().longValue()){ 295 return true; 296 } else { 297 return false; 298 } 299 } 300 301 304 public int hashCode() { 305 return new HashCodeBuilder().append(getIdUser()).toHashCode(); 306 } 307 308 311 public Long getUser_posts() { 312 return user_posts; 313 } 314 315 318 public void setUser_posts(Long user_posts) { 319 this.user_posts = user_posts; 320 } 321 322 325 public Integer getAdmin() { 326 return admin; 327 } 328 329 332 public void setAdmin(Integer admin) { 333 this.admin = admin; 334 } 335 336 339 public boolean isAdministrator() { 340 return getAdmin().intValue() == 1; 341 } 342 343 346 public Date getDataRegistro() { 347 return dataRegistro; 348 } 349 350 353 public void setDataRegistro(Date dataRegistro) { 354 this.dataRegistro = dataRegistro; 355 } 356 357 358 361 public String getLocalizacao() { 362 return localizacao; 363 } 364 365 368 public void setLocalizacao(String localizacao) { 369 this.localizacao = localizacao; 370 } 371 372 375 public String getWebsite() { 376 return website; 377 } 378 379 382 public void setWebsite(String website) { 383 this.website = website; 384 } 385 386 389 public String getOccupation() { 390 return occupation; 391 } 392 393 396 public void setOccupation(String occupation) { 397 this.occupation = occupation; 398 } 399 400 403 public String getUserSig() { 404 return userSig; 405 } 406 407 411 public String getUserSig_formated() { 412 String ret; 413 try { 414 postFormatter.setAcceptHTML(false); 415 postFormatter.setAcceptBBCode(true); 416 ret = postFormatter.preparePostText(getUserSig()); 417 } catch (Exception e) { 418 ret = userSig; 419 } 420 return ret; 421 } 422 423 426 public void setUserSig(String userSig) { 427 this.userSig = userSig; 428 } 429 430 433 public String getUser_aim() { 434 return user_aim; 435 } 436 437 440 public void setUser_aim(String user_aim) { 441 this.user_aim = user_aim; 442 } 443 444 447 public String getHash_fpwd() { 448 return hash_fpwd; 449 } 450 451 454 public void setHash_fpwd(String hash_fpwd) { 455 this.hash_fpwd = hash_fpwd; 456 } 457 458 461 public String getUser_avatar() { 462 return user_avatar; 463 } 464 465 468 public void setUser_avatar(String user_avatar) { 469 this.user_avatar = user_avatar; 470 } 471 472 475 public String getUser_dateformat() { 476 return user_dateformat; 477 } 478 479 482 public void setUser_dateformat(String user_dateformat) { 483 this.user_dateformat = user_dateformat; 484 } 485 486 489 public String getUser_icq() { 490 return user_icq; 491 } 492 493 496 public void setUser_icq(String user_icq) { 497 this.user_icq = user_icq; 498 } 499 500 503 public String getUser_interests() { 504 return user_interests; 505 } 506 507 510 public void setUser_interests(String user_interests) { 511 this.user_interests = user_interests; 512 } 513 514 517 public String getUser_msnm() { 518 return user_msnm; 519 } 520 521 524 public void setUser_msnm(String user_msnm) { 525 this.user_msnm = user_msnm; 526 } 527 528 531 public String getUser_sig() { 532 return user_sig; 533 } 534 535 538 public void setUser_sig(String user_sig) { 539 this.user_sig = user_sig; 540 } 541 542 545 public String getUser_yim() { 546 return user_yim; 547 } 548 549 552 public void setUser_yim(String user_yim) { 553 this.user_yim = user_yim; 554 } 555 556 559 public Date getUser_lastvisit() { 560 return user_lastvisit; 561 } 562 563 566 public void setUser_lastvisit(Date user_lastvisit) { 567 this.user_lastvisit = user_lastvisit; 568 } 569 570 573 public String getUser_allow_viewonline() { 574 return user_allow_viewonline; 575 } 576 577 580 public void setUser_allow_viewonline(String user_allow_viewonline) { 581 this.user_allow_viewonline = user_allow_viewonline; 582 } 583 584 587 public Integer getShow_mail() { 588 return show_mail; 589 } 590 591 594 public void setShow_mail(Integer show_mail) { 595 this.show_mail = show_mail; 596 } 597 598 601 public Integer getShow_signature() { 602 return show_signature; 603 } 604 605 608 public void setShow_signature(Integer show_signature) { 609 this.show_signature = show_signature; 610 } 611 612 615 public Integer getUserStatus() { 616 return userStatus; 617 } 618 619 622 public void setUserStatus(Integer userStatus) { 623 this.userStatus = userStatus; 624 } 625 626 629 public String getUserCode() { 630 return userCode; 631 } 632 633 636 public void setUserCode(String userCode) { 637 this.userCode = userCode; 638 } 639 640 643 public Date getLastVisitTimestamp() { 644 return _lastVisitTimestamp; 645 } 646 647 650 public void setLastVisitTimestamp(Date lastVisitTimestamp) { 651 this._lastVisitTimestamp = lastVisitTimestamp; 652 } 653 656 public Set getAnswerNotifies() { 657 return answerNotifies; 658 } 659 662 public void setAnswerNotifies(Set answerNotifies) { 663 this.answerNotifies = answerNotifies; 664 } 665 666 public Set getForumTopUsers() { 667 return forumTopUsers; 668 } 669 670 public void setForumTopUsers(Set forumTopUsers) { 671 this.forumTopUsers = forumTopUsers; 672 } 673 674 public Set getFavUserTopics() { 675 return favUserTopics; 676 } 677 678 public void setFavUserTopics(Set favUserTopics) { 679 this.favUserTopics = favUserTopics; 680 } 681 } 682 | Popular Tags |