From e001fdc08bc50d73b2920bb96e85c481bdee1c1f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 8 Feb 2016 20:44:19 +0300 Subject: add pm and recommendations --- src/main/java/com/juick/Message.java | 27 ++++++++++++++++++++++----- src/main/java/com/juick/PM.java | 16 ++++++++++++++++ src/main/java/com/juick/Recommendation.java | 16 ++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/juick/PM.java create mode 100644 src/main/java/com/juick/Recommendation.java (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/Message.java b/src/main/java/com/juick/Message.java index 003622ec..c6e10214 100644 --- a/src/main/java/com/juick/Message.java +++ b/src/main/java/com/juick/Message.java @@ -17,9 +17,7 @@ */ package com.juick; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; +import java.util.*; /** * @@ -34,7 +32,7 @@ public class Message { public int ReplyTo = 0; private String Text = null; private User User = null; - public ArrayList Tags = new ArrayList(); + public List Tags = new ArrayList<>(); private Date date = null; public int TimeAgo = 0; public int Privacy = 1; @@ -50,7 +48,9 @@ public class Message { public Place Place = null; public int Likes = 0; public boolean UserLike = false; - public ArrayList childs = new ArrayList(); + public ArrayList childs = new ArrayList<>(); + private Optional PM = Optional.empty(); + Optional Recommendation = Optional.empty(); public Message() { } @@ -76,6 +76,8 @@ public class Message { Likes = msg.Likes; UserLike = msg.UserLike; childs = msg.childs; + PM = msg.PM; + Recommendation = msg.Recommendation; } public void parseTags(String strTags) { @@ -215,4 +217,19 @@ public class Message { this.date = date; } + + public Optional getPM() { + return PM; + } + + public void setPM(com.juick.PM PM) { + this.PM = Optional.ofNullable(PM); + } + + public Optional getRecommendation() { + return Recommendation; + } + public void setRecommendation(Recommendation recommendation) { + this.Recommendation = Optional.ofNullable(recommendation); + } } diff --git a/src/main/java/com/juick/PM.java b/src/main/java/com/juick/PM.java new file mode 100644 index 00000000..658cafc9 --- /dev/null +++ b/src/main/java/com/juick/PM.java @@ -0,0 +1,16 @@ +package com.juick; + +/** + * Created by vt on 08/02/16. + */ +public class PM { + private User to; + + public User getTo() { + return to; + } + + public PM(User to) { + this.to = to; + } +} diff --git a/src/main/java/com/juick/Recommendation.java b/src/main/java/com/juick/Recommendation.java new file mode 100644 index 00000000..4cfa67c2 --- /dev/null +++ b/src/main/java/com/juick/Recommendation.java @@ -0,0 +1,16 @@ +package com.juick; + +/** + * Created by vt on 08/02/16. + */ +public class Recommendation { + User from; + + public User getFrom() { + return from; + } + + public Recommendation(User from) { + this.from = from; + } +} -- cgit v1.2.3