/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package my.home.model.entities;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. 

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Entity mapped to table CHAT_ITEM.
 */
public class ChatItem implements Parcelable {

    private Long id;
    /**
     * Not-null value.
     */
    private String content;
    private boolean isMe;
    private int state;
    private int seq;
    private java.util.Date date;

    public ChatItem() {
    }

    public ChatItem(Long id) {
        this.id = id;
    }

    public ChatItem(Long id, String content, boolean isMe, int state, int seq, java.util.Date date) {
        this.id = id;
        this.content = content;
        this.isMe = isMe;
        this.state = state;
        this.seq = seq;
        this.date = date;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Not-null value.
     */
    public String getContent() {
        return content;
    }

    /**
     * Not-null value; ensure this value is available before it is saved to the database.
     */
    public void setContent(String content) {
        this.content = content;
    }

    public boolean getIsMe() {
        return isMe;
    }

    public void setIsMe(boolean isMe) {
        this.isMe = isMe;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public java.util.Date getDate() {
        return date;
    }

    public void setDate(java.util.Date date) {
        this.date = date;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    /*
        private String content;
        private boolean isMe;
        private int state;
        private int seq;
        private java.util.Date date;
     */
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(content);
        dest.writeInt(isMe ? 1 : 0);
        dest.writeInt(state);
        dest.writeInt(seq);
        dest.writeLong(date.getTime());
    }

    public static final Parcelable.Creator<ChatItem> CREATOR = new Parcelable.Creator<ChatItem>() {

        @Override
        public ChatItem[] newArray(int size) {
            return new ChatItem[size];
        }

        @Override
        public ChatItem createFromParcel(Parcel source) {
            return new ChatItem(source);
        }
    };

    private ChatItem(Parcel in) {
        ChatItem info = new ChatItem();
        info.setId(in.readLong());
        info.setContent(in.readString());
        info.setIsMe(in.readInt() == 1);
        info.setState(in.readInt());
        info.setSeq(in.readInt());
        info.setDate(new java.util.Date(in.readLong()));
    }

    @Override
    public String toString() {
        return "info: " + id + "\n"
                + "content: " + content + "\n"
                + "isMe: " + isMe + "\n"
                + "state: " + state + "\n"
                + "seq: " + seq + "\n"
                + "date: " + date + "\n";
    }
}

@@ -3232,53 +3232,8 @@
     
-ChatItem info = new ChatItem();%0A        info.
 setI
@@ -3258,21 +3258,16 @@
         
-info.
 setConte
@@ -3295,21 +3295,16 @@
         
-info.
 setIsMe(
@@ -3327,29 +3327,24 @@
 1);%0A        
-info.
 setState(in.
@@ -3363,21 +3363,16 @@
         
-info.
 setSeq(i
@@ -3397,13 +3397,8 @@
     
-info.
 setD

fix bug: ChatItem Parcel Contructor error