1 package org.javabb.vo; 2 3 import java.io.Serializable ; 4 import org.apache.commons.lang.builder.CompareToBuilder; 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 import org.apache.commons.lang.builder.HashCodeBuilder; 7 import org.apache.commons.lang.builder.ToStringBuilder; 8 9 12 public class UserRank implements Comparable , Serializable { 13 private Long rankId; 14 private String rankName; 15 private Integer rankMin; 16 private Integer rankMax; 17 private String rankImage; 18 19 20 public Long getRankId() { 21 return rankId; 22 } 23 public void setRankId(Long rankId) { 24 this.rankId = rankId; 25 } 26 public String getRankImage() { 27 return rankImage; 28 } 29 public void setRankImage(String rankImage) { 30 this.rankImage = rankImage; 31 } 32 public Integer getRankMax() { 33 return rankMax; 34 } 35 public void setRankMax(Integer rankMax) { 36 this.rankMax = rankMax; 37 } 38 public Integer getRankMin() { 39 return rankMin; 40 } 41 public void setRankMin(Integer rankMin) { 42 this.rankMin = rankMin; 43 } 44 public String getRankName() { 45 return rankName; 46 } 47 public void setRankName(String rankName) { 48 this.rankName = rankName; 49 } 50 53 public int compareTo(Object object) { 54 UserRank myClass = (UserRank) object; 55 return new CompareToBuilder().append(this.rankId, myClass.rankId) 56 .toComparison(); 57 } 58 61 public boolean equals(Object object) { 62 if (!(object instanceof UserRank)) { 63 return false; 64 } 65 UserRank rhs = (UserRank) object; 66 return new EqualsBuilder().appendSuper(super.equals(object)) 67 .append(this.rankId, rhs.rankId) 68 .isEquals(); 69 } 70 73 public int hashCode() { 74 return new HashCodeBuilder(-602096293, -334566575).appendSuper( 75 super.hashCode()).append( 76 this.rankId).toHashCode(); 77 } 78 81 public String toString() { 82 return new ToStringBuilder(this).append("rankMin", this.rankMin) 83 .append("rankName", this.rankName) 84 .append("rankId", this.rankId).append("rankImage", 85 this.rankImage).append("rankMax", this.rankMax) 86 .toString(); 87 } 88 89 90 } 91 | Popular Tags |