Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.provider.BaseColumns;
- import com.activeandroid.annotation.Column;
- import com.activeandroid.annotation.Table;
- import com.fasterxml.jackson.annotation.JsonProperty;
- public class Comment extends BaseModel implements Parcelable {
- public static final Parcelable.Creator<Comment> CREATOR
- = new Parcelable.Creator<Comment>() {
- public Comment createFromParcel(Parcel in) {
- return new Comment(in);
- }
- public Comment[] newArray(int size) {
- return new Comment[size];
- }
- };
- public static final String USER = "user";
- public static final String COMMENT = "comment";
- public Comment() {}
- public Comment(Parcel in) {
- load(Comment.class, in.readInt());
- }
- @JsonProperty("id")
- private int remoteId;
- @JsonProperty("nome")
- private String mUsername;
- @JsonProperty("mensagem")
- private String mComment;
- public int getRemoteId() {
- return remoteId;
- }
- public void setRemoteId(int remoteId) {
- this.remoteId = remoteId;
- }
- public String getmUsername() {
- return mUsername;
- }
- public void setmUsername(String mUsername) {
- this.mUsername = mUsername;
- }
- public String getmComment() {
- return mComment;
- }
- public void setmComment(String mComment) {
- this.mComment = mComment;
- }
- public ContentValues toContentValues() {
- ContentValues values = new ContentValues();
- values.put(BaseModel._RID, getmUsername());
- values.put(USER, getmUsername());
- values.put(COMMENT, getmComment();
- return values;
- }
- @Override
- public int describeContents() {
- return 0;
- }
- @Override
- public void writeToParcel(Parcel parcel, int flag) {
- parcel.writeInt(getRemoteId());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment