From f3de17fa7152ccc7637709835a49a0a1baaa611e Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Mon, 14 Nov 2016 04:14:29 +0700 Subject: some fields are finalized; equals() improvements --- juick-core/src/main/java/com/juick/User.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'juick-core/src/main/java/com/juick/User.java') diff --git a/juick-core/src/main/java/com/juick/User.java b/juick-core/src/main/java/com/juick/User.java index a8109e50..b8936bab 100644 --- a/juick-core/src/main/java/com/juick/User.java +++ b/juick-core/src/main/java/com/juick/User.java @@ -21,11 +21,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** - * * @author Ugnich Anton */ public class User { - private int UID = 0; private String UName = null; @JsonIgnore @@ -53,7 +51,8 @@ public class User { @Override public boolean equals(Object obj) { - return (obj instanceof User && ((User) obj).getUID() == this.getUID()); + return obj == this || + (obj instanceof User && ((User) obj).getUID() == this.getUID()); } @JsonProperty("uid") @@ -100,10 +99,12 @@ public class User { public void setAuthHash(String authHash) { AuthHash = authHash; } + @JsonProperty("unreadCount") public Integer getUnreadCount() { return MessagesCount; } + public void setUnreadCount(Integer count) { MessagesCount = count; } -- cgit v1.2.3