From f010d75872763547ecbe621ae3e8eb967950453f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 13 Mar 2018 15:18:03 +0300 Subject: core: cleanup unused message properties --- juick-core/src/main/java/com/juick/Message.java | 62 +------------------------ 1 file changed, 2 insertions(+), 60 deletions(-) (limited to 'juick-core/src/main/java/com/juick/Message.java') diff --git a/juick-core/src/main/java/com/juick/Message.java b/juick-core/src/main/java/com/juick/Message.java index 0d91cc63..699920f6 100644 --- a/juick-core/src/main/java/com/juick/Message.java +++ b/juick-core/src/main/java/com/juick/Message.java @@ -21,13 +21,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.juick.xml.adapters.SimpleDateAdapter; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.time.Instant; -import java.util.*; +import java.util.ArrayList; +import java.util.List; /** * @author Ugnich Anton @@ -67,30 +67,13 @@ public class Message implements Comparable { private Photo photo; @XmlTransient private Attachment attachment; - public String Video = null; - public Place Place = null; private int likes; - public final List childs; private User to; private Recommendation Recommendation; private String replyQuote; public Message() { tags = new ArrayList<>(); - childs = new ArrayList<>(); - } - - public void parseTags(String strTags) { - if (StringUtils.isNotEmpty(strTags)) { - Set tagSet = new TreeSet<>(tags); - for (String str : strTags.split(" ")) { - Tag tag = new Tag(str); - if (!tagSet.contains(tag)) { - tags.add(tag); - tagSet.add(tag); - } - } - } } @Override @@ -140,47 +123,6 @@ public class Message implements Comparable { return cmp; } - @JsonIgnore - public int getChildsCount() { - int cnt = childs.size(); - for (Message child : childs) { - cnt += child.getChildsCount(); - } - return cnt; - } - - public void cleanupChilds() { - if (!childs.isEmpty()) { - for (Message child : childs) { - child.cleanupChilds(); - } - childs.clear(); - } - } - - @JsonIgnore - public String getTagsString() { - StringBuilder builder = new StringBuilder(); - if (!tags.isEmpty()) { - for (Tag Tag : tags) - builder.append(" *").append(Tag.getName()); - - if (FriendsOnly) - builder.append(" *friends"); - - if (privacy == -2) - builder.append(" *private"); - else if (privacy == -1) - builder.append(" *friends"); - else if (privacy == 2) - builder.append(" *public"); - - if (ReadOnly) - builder.append(" *readonly"); - } - return builder.toString(); - } - @JsonProperty("mid") @XmlAttribute(name = "mid") public int getMid() { -- cgit v1.2.3