ppamorim

Untitled

Sep 26th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.88 KB | None | 0 0
  1. import android.provider.BaseColumns;
  2.  
  3. import com.activeandroid.annotation.Column;
  4. import com.activeandroid.annotation.Table;
  5. import com.fasterxml.jackson.annotation.JsonProperty;
  6.  
  7. public class Comment extends BaseModel implements Parcelable {
  8.  
  9.     public static final Parcelable.Creator<Comment> CREATOR
  10.             = new Parcelable.Creator<Comment>() {
  11.  
  12.         public Comment createFromParcel(Parcel in) {
  13.             return new Comment(in);
  14.         }
  15.         public Comment[] newArray(int size) {
  16.             return new Comment[size];
  17.         }
  18.     };
  19.  
  20.     public static final String USER = "user";
  21.     public static final String COMMENT = "comment";
  22.  
  23.     public Comment() {}
  24.  
  25.     public Comment(Parcel in) {
  26.         load(Comment.class, in.readInt());
  27.     }
  28.  
  29.     @JsonProperty("id")
  30.     private int remoteId;
  31.  
  32.     @JsonProperty("nome")
  33.     private String mUsername;
  34.  
  35.     @JsonProperty("mensagem")
  36.     private String mComment;
  37.  
  38.     public int getRemoteId() {
  39.         return remoteId;
  40.     }
  41.  
  42.     public void setRemoteId(int remoteId) {
  43.         this.remoteId = remoteId;
  44.     }
  45.  
  46.     public String getmUsername() {
  47.         return mUsername;
  48.     }
  49.  
  50.     public void setmUsername(String mUsername) {
  51.         this.mUsername = mUsername;
  52.     }
  53.  
  54.     public String getmComment() {
  55.         return mComment;
  56.     }
  57.  
  58.     public void setmComment(String mComment) {
  59.         this.mComment = mComment;
  60.     }
  61.  
  62.     public ContentValues toContentValues() {
  63.  
  64.         ContentValues values = new ContentValues();
  65.    
  66.     values.put(BaseModel._RID, getmUsername());
  67.         values.put(USER, getmUsername());
  68.     values.put(COMMENT, getmComment();
  69.  
  70.         return values;
  71.     }
  72.  
  73.     @Override
  74.     public int describeContents() {
  75.         return 0;
  76.     }
  77.  
  78.     @Override
  79.     public void writeToParcel(Parcel parcel, int flag) {
  80.         parcel.writeInt(getRemoteId());
  81.     }
  82.  
  83. }
Advertisement
Add Comment
Please, Sign In to add comment