diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 15:53:24 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 15:53:24 -0700 |
commit | 371ccae3d1f31ec38f4af77fb7fcd175d49b3cd5 (patch) | |
tree | 38c4f1e8828f9af9c4b77a173bee0d312b321698 /src/main/java/com/p4square/grow/model/Message.java | |
parent | bbf907e51dfcf157bdee24dead1d531122aa25db (diff) | |
parent | 3102d8bce3426d9cf41aeaf201c360d342677770 (diff) |
Merge pull request #10 from PuyallupFoursquare/maven
Switching from Ivy+Ant to Maven.
Diffstat (limited to 'src/main/java/com/p4square/grow/model/Message.java')
-rw-r--r-- | src/main/java/com/p4square/grow/model/Message.java | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/main/java/com/p4square/grow/model/Message.java b/src/main/java/com/p4square/grow/model/Message.java new file mode 100644 index 0000000..9d33320 --- /dev/null +++ b/src/main/java/com/p4square/grow/model/Message.java @@ -0,0 +1,103 @@ +/* + * Copyright 2013 Jesse Morgan + */ + +package com.p4square.grow.model; + +import java.util.Date; +import java.util.UUID; + +/** + * A feed message. + * + * @author Jesse Morgan <jesse@jesterpm.net> + */ +public class Message { + private String mThreadId; + private String mId; + private UserRecord mAuthor; + private Date mCreated; + private String mMessage; + + /** + * @return a new message id. + */ + public static String generateId() { + return String.format("%x-%s", System.currentTimeMillis(), UUID.randomUUID().toString()); + } + + /** + * @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 UserRecord getAuthor() { + return mAuthor; + } + + /** + * Set the author of the message. + * @param author The new author. + */ + public void setAuthor(UserRecord 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; + } +} |