package com.corneliudascalu.mvpnotes.data.model;

import org.joda.time.DateTime;

/**
 * Simple model of a note
 *
 * @author Corneliu Dascalu <corneliu.dascalu@gmail.com>
 */
public class Note {

    public long id;

    public String title;

    public String text;

    public DateTime createdDate;

    /**
     * A note-related error. I find it useful to define exceptions this way, to make it easy and
     * clear when using an
     * event bus.
     */
    public static class Error extends Exception {

        private long id;

        public Note note;

        public Error(Note note, String s) {
            super(s);
            this.note = note;
        }

        public Error(long id, String s) {
            super();
            this.id = id;
        }
    }
}

@@ -75,16 +75,73 @@
 eTime;%0A%0A
+import android.os.Parcel;%0Aimport android.os.Parcelable;%0A%0A
 /**%0A * S
@@ -244,16 +244,38 @@
 ss Note 
+implements Parcelable 
 %7B%0A%0A    p
@@ -843,16 +843,851 @@
       %7D%0A
-
     %7D
+%0A%0A    @Override%0A    public int describeContents() %7B%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public void writeToParcel(Parcel dest, int flags) %7B%0A        dest.writeLong(this.id);%0A        dest.writeString(this.title);%0A        dest.writeString(this.text);%0A        dest.writeString(this.createdDate.toString());%0A    %7D%0A%0A    public Note() %7B%0A    %7D%0A%0A    private Note(Parcel in) %7B%0A        this.id = in.readLong();%0A        this.title = in.readString();%0A        this.text = in.readString();%0A        this.createdDate = new DateTime(in.readString());%0A    %7D%0A%0A    public static final Parcelable.Creator%3CNote%3E CREATOR = new Parcelable.Creator%3CNote%3E() %7B%0A        public Note createFromParcel(Parcel source) %7B%0A            return new Note(source);%0A        %7D%0A%0A        public Note%5B%5D newArray(int size) %7B%0A            return new Note%5Bsize%5D;%0A        %7D%0A    %7D;
 %0A%7D%0A

Implement Parcelable in Note