diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2014-02-01 11:18:41 -0800 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2014-02-01 11:18:41 -0800 |
commit | 710880b563734d71e9a29276bb259d53218ea67c (patch) | |
tree | 5645601ccd5b886e4360e208e6c37ebf6456b739 /src/com/p4square/grow/model | |
parent | a7e5eb45f68c7c6862b3ad29361114059f5dae3f (diff) |
Adding the feed backend support.
Diffstat (limited to 'src/com/p4square/grow/model')
-rw-r--r-- | src/com/p4square/grow/model/Message.java | 95 | ||||
-rw-r--r-- | src/com/p4square/grow/model/MessageThread.java | 43 |
2 files changed, 138 insertions, 0 deletions
diff --git a/src/com/p4square/grow/model/Message.java b/src/com/p4square/grow/model/Message.java new file mode 100644 index 0000000..6e07150 --- /dev/null +++ b/src/com/p4square/grow/model/Message.java @@ -0,0 +1,95 @@ +/* + * Copyright 2013 Jesse Morgan + */ + +package com.p4square.grow.model; + +import java.util.Date; + +/** + * A feed message. + * + * @author Jesse Morgan <jesse@jesterpm.net> + */ +public class Message { + private String mThreadId; + private String mId; + private String mAuthor; + private Date mCreated; + private String mMessage; + + /** + * @return The id of the thread that the message belongs to. + */ + public String getThreadId() { + return mThreadId; + } + + /** + * Set the id of the thread that the message belongs to. + * @param id The new thread id. + */ + public void setThreadId(String id) { + mThreadId = id; + } + + /** + * @return The id the message. + */ + public String getId() { + return mId; + } + + /** + * Set the id of the message. + * @param id The new message id. + */ + public void setId(String id) { + mId = id; + } + + /** + * @return The author of the message. + */ + public String getAuthor() { + return mAuthor; + } + + /** + * Set the author of the message. + * @param author The new author. + */ + public void setAuthor(String author) { + mAuthor = author; + } + + /** + * @return The Date the message was created. + */ + public Date getCreated() { + return mCreated; + } + + /** + * Set the Date the message was created. + * @param date The new creation date. + */ + public void setCreated(Date date) { + mCreated = date; + } + + /** + * @return The message text. + */ + public String getMessage() { + return mMessage; + } + + /** + * Set the message text. + * @param text The message text. + */ + public void setMessage(String text) { + mMessage = text; + } +} diff --git a/src/com/p4square/grow/model/MessageThread.java b/src/com/p4square/grow/model/MessageThread.java new file mode 100644 index 0000000..f93ec13 --- /dev/null +++ b/src/com/p4square/grow/model/MessageThread.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013 Jesse Morgan + */ + +package com.p4square.grow.model; + +import java.util.UUID; + +/** + * + * @author Jesse Morgan <jesse@jesterpm.net> + */ +public class MessageThread { + private String mId; + + /** + * Create a new thread with a probably unique id. + * + * @return the new thread. + */ + public static MessageThread createNew() { + MessageThread t = new MessageThread(); + t.setId(String.format("%x-%s", System.currentTimeMillis(), UUID.randomUUID().toString())); + + return t; + } + + /** + * @return The id the message. + */ + public String getId() { + return mId; + } + + /** + * Set the id of the message. + * @param id The new message id. + */ + public void setId(String id) { + mId = id; + } + +} |