summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/model/Message.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/p4square/grow/model/Message.java')
-rw-r--r--src/com/p4square/grow/model/Message.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/p4square/grow/model/Message.java b/src/com/p4square/grow/model/Message.java
index ad02af9..9d33320 100644
--- a/src/com/p4square/grow/model/Message.java
+++ b/src/com/p4square/grow/model/Message.java
@@ -5,6 +5,7 @@
package com.p4square.grow.model;
import java.util.Date;
+import java.util.UUID;
/**
* A feed message.
@@ -19,6 +20,13 @@ public class Message {
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() {