diff options
Diffstat (limited to 'juick-core/src/main/java/com')
-rw-r--r-- | juick-core/src/main/java/com/juick/User.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/juick-core/src/main/java/com/juick/User.java b/juick-core/src/main/java/com/juick/User.java index f71ec781..03805a65 100644 --- a/juick-core/src/main/java/com/juick/User.java +++ b/juick-core/src/main/java/com/juick/User.java @@ -19,6 +19,8 @@ package com.juick; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; import javax.xml.bind.annotation.*; @@ -36,6 +38,7 @@ public class User { private int messagesCount; private String authHash; private boolean banned; + private String credentials; public User() { } @@ -57,6 +60,25 @@ public class User { (obj instanceof User && ((User) obj).getUid() == this.getUid()); } + @Override + public int hashCode() { + return new HashCodeBuilder() + .append(getUid()) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this) + .append("uid", uid) + .append("name", name) + .append("fullName", fullName) + .append("jid", jid) + .append("messagesCount", messagesCount) + .append("banned", banned) + .toString(); + } + @JsonProperty("uid") @XmlAttribute(name = "uid") public int getUid() { @@ -132,4 +154,14 @@ public class User { public void setAvatar(Object avatar) { this.avatar = avatar; } + + @XmlTransient + @JsonIgnore + public String getCredentials() { + return credentials; + } + + public void setCredentials(String credentials) { + this.credentials = credentials; + } } |