diff options
author | alx | 2019-03-16 23:56:27 +0300 |
---|---|---|
committer | alx | 2019-03-16 23:56:27 +0300 |
commit | 06105f76dbfa3b65e63ed06f9c4d5107bd49ed88 (patch) | |
tree | 5702c01cec9688039d891f4a711878706101c1c5 /src/main/java/com/juick/User.java | |
parent | 3ea4cd1942fa4e763034da11c5fa429407b67829 (diff) | |
parent | a49105285d0d7719d7f222a507af2d5ac5b4bdb1 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/com/juick/User.java')
-rw-r--r-- | src/main/java/com/juick/User.java | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/main/java/com/juick/User.java b/src/main/java/com/juick/User.java index 7221e416..f34f07a8 100644 --- a/src/main/java/com/juick/User.java +++ b/src/main/java/com/juick/User.java @@ -53,6 +53,9 @@ public class User { private URI uri; private Instant seen; private boolean verified; + private String country; + private String url; + private String description; public User() { tokens = new ArrayList<>(); @@ -62,12 +65,13 @@ public class User { @Override public boolean equals(Object obj) { return obj == this || - (obj instanceof User && ((User) obj).getUid() == this.getUid()); + (obj instanceof User && ((User) obj).getUid() == this.getUid() + && ((User) obj).getUri().toString().equals(this.getUri().toString())); } @Override public int hashCode() { - return Objects.hash(uid); + return Objects.hash(uid, uri); } @Override @@ -170,7 +174,7 @@ public class User { @XmlTransient @JsonIgnore public boolean isAnonymous() { - return false; + return uid == 0; } @Nonnull @@ -206,6 +210,7 @@ public class User { } @Nonnull + @XmlTransient public URI getUri() { if (uri == null) { uri = URI.create(StringUtils.EMPTY); @@ -225,6 +230,7 @@ public class User { this.seen = seen; } + @XmlTransient public boolean isVerified() { return verified; } @@ -232,4 +238,28 @@ public class User { public void setVerified(boolean verified) { this.verified = verified; } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } } |