diff options
Diffstat (limited to 'src/main/java/com')
3 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Hashtag.java b/src/main/java/com/juick/www/api/activity/model/objects/Hashtag.java index 0f524d72..cecefc18 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Hashtag.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Hashtag.java @@ -20,7 +20,7 @@ package com.juick.www.api.activity.model.objects; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -public class Hashtag extends Mention { +public class Hashtag extends Link { @JsonCreator public Hashtag(@JsonProperty("href") String href, @JsonProperty("name") String name) { super(href, name); diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Link.java b/src/main/java/com/juick/www/api/activity/model/objects/Link.java index c544c4b2..5c31d789 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Link.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Link.java @@ -17,9 +17,16 @@ package com.juick.www.api.activity.model.objects; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import com.juick.www.api.activity.model.Context; public class Link extends Context { + @JsonCreator + public Link(@JsonProperty("href") String href, @JsonProperty("name") String name) { + this.setHref(href); + this.setName(name); + } private String href; public String getHref() { diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Mention.java b/src/main/java/com/juick/www/api/activity/model/objects/Mention.java index 30ba4d10..169a8960 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Mention.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Mention.java @@ -26,7 +26,6 @@ import com.juick.util.UserUtils; public class Mention extends Link { @JsonCreator public Mention(@JsonProperty("href") String href, @JsonProperty("name") String name) { - this.setHref(href); - this.setName(UserUtils.getPersonIdentifier(name, URI.create(href))); + super(href, UserUtils.getPersonIdentifier(name, URI.create(href))); } } |