diff options
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; + } } |