package com.phlx.anchorcollect_p.entity;

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

import androidx.databinding.BaseObservable;

import org.greenrobot.greendao.annotation.Generated;

public class ErrorEntity extends BaseObservable implements Parcelable {

    /**
     * 主键
     */
    private Long id;

    /**
     * 类型
     */
    private String type;

    /**
     * 内容
     */
    private String content;

    /**
     * 部门id
     */
    private Long deptId;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间 "yyyy-MM-dd HH:mm:ss"
     */
    private String createTime;

    public ErrorEntity() {
    }

    protected ErrorEntity(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        type = in.readString();
        content = in.readString();
        if (in.readByte() == 0) {
            deptId = null;
        } else {
            deptId = in.readLong();
        }
        createBy = in.readString();
        createTime = in.readString();
    }

    @Generated(hash = 573013660)
    public ErrorEntity(Long id, String type, String content, Long deptId,
            String createBy, String createTime) {
        this.id = id;
        this.type = type;
        this.content = content;
        this.deptId = deptId;
        this.createBy = createBy;
        this.createTime = createTime;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeString(type);
        dest.writeString(content);
        if (deptId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(deptId);
        }
        dest.writeString(createBy);
        dest.writeString(createTime);
    }

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

    public static final Creator<ErrorEntity> CREATOR = new Creator<ErrorEntity>() {
        @Override
        public ErrorEntity createFromParcel(Parcel in) {
            return new ErrorEntity(in);
        }

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

    public Long getId() {
        return id;
    }

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

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "ErrorEntity{" +
                "id=" + id +
                ", type='" + type + '\'' +
                ", content='" + content + '\'' +
                ", deptId=" + deptId +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                '}';
    }
}
