diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2014-02-22 18:15:15 -0800 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2014-02-22 18:15:15 -0800 |
commit | 9323fd4f9077bd876e0e220fda6bfd2192dadd59 (patch) | |
tree | c8d7054d1710de70460b42d98fa3c87131762a1b /src/com/p4square/grow/model | |
parent | 586e997fae3f7c262e3098a0c82b531f745db5ee (diff) |
Adding support to post new messages.
Other Changes:
* JsonEncodedProvider no longer implements Provider.
* Only the first answer is shown. Others slide down.
* Switch going deeper and the feed.
Diffstat (limited to 'src/com/p4square/grow/model')
-rw-r--r-- | src/com/p4square/grow/model/Message.java | 6 | ||||
-rw-r--r-- | src/com/p4square/grow/model/UserRecord.java | 93 |
2 files changed, 96 insertions, 3 deletions
diff --git a/src/com/p4square/grow/model/Message.java b/src/com/p4square/grow/model/Message.java index 6e07150..ad02af9 100644 --- a/src/com/p4square/grow/model/Message.java +++ b/src/com/p4square/grow/model/Message.java @@ -14,7 +14,7 @@ import java.util.Date; public class Message { private String mThreadId; private String mId; - private String mAuthor; + private UserRecord mAuthor; private Date mCreated; private String mMessage; @@ -51,7 +51,7 @@ public class Message { /** * @return The author of the message. */ - public String getAuthor() { + public UserRecord getAuthor() { return mAuthor; } @@ -59,7 +59,7 @@ public class Message { * Set the author of the message. * @param author The new author. */ - public void setAuthor(String author) { + public void setAuthor(UserRecord author) { mAuthor = author; } diff --git a/src/com/p4square/grow/model/UserRecord.java b/src/com/p4square/grow/model/UserRecord.java new file mode 100644 index 0000000..0702eb1 --- /dev/null +++ b/src/com/p4square/grow/model/UserRecord.java @@ -0,0 +1,93 @@ +/* + * Copyright 2014 Jesse Morgan + */ + +package com.p4square.grow.model; + +import org.restlet.security.User; + +/** + * A simple user representation without any secrets. + */ +public class UserRecord { + private String mId; + private String mFirstName; + private String mLastName; + private String mEmail; + + /** + * Create an empty UserRecord. + */ + public UserRecord() { + } + + /** + * Create a new UserRecord with the information from a User. + */ + public UserRecord(final User user) { + mId = user.getIdentifier(); + mFirstName = user.getFirstName(); + mLastName = user.getLastName(); + mEmail = user.getEmail(); + } + + /** + * @return The user's identifier. + */ + public String getId() { + return mId; + } + + /** + * Set the user's identifier. + * @param value The new id. + */ + public void setId (final String value) { + mId = value; + } + + /** + * @return The user's email. + */ + public String getEmail() { + return mEmail; + } + + /** + * Set the user's email. + * @param value The new email. + */ + public void setEmail (final String value) { + mEmail = value; + } + + /** + * @return The user's first name. + */ + public String getFirstName() { + return mFirstName; + } + + /** + * Set the user's first name. + * @param value The new first name. + */ + public void setFirstName (final String value) { + mFirstName = value; + } + + /** + * @return The user's last name. + */ + public String getLastName() { + return mLastName; + } + + /** + * Set the user's last name. + * @param value The new last name. + */ + public void setLastName (final String value) { + mLastName = value; + } +} |