package com.phlx.wool.entity;

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

import androidx.databinding.BaseObservable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;

/**
 * <pre>
 *     author : lei
 *     e-mail : 18600395998@163.com
 *     time   : 2020/04/10
 *     desc   : 发标记录表
 *     version: 1.0
 * </pre>
 */
@Entity
public class QuarantineDetail extends BaseObservable implements Parcelable {

    @Id(autoincrement = true)
    @Expose(serialize = false, deserialize = false)
    private Long id;

    /**
     * 主表ID
     */
    @Index(name = "quarantineId")
    private Long quarantineId;

    /**
     * 养殖单位ID
     */
    @SerializedName("preflagunit")
    private String receivingUnit;

    /**
     * 耳标EPC
     */
    @SerializedName("slugno")
    private String Epc;

    /**
     * 二维码号
     */
    @SerializedName("twodimensionno")
    private String twodimensionno;

    /**
     * 耳标tid
     */
    @Index(name = "QuarantineTid", unique = true)
    @SerializedName("innercode")
    private String Tid;


    /**
     * 合法状态 0 非法 1 合法
     */
    @SerializedName("qualified")
    private String isLegalStatus;


    @SerializedName("inputTime")
    private long timestamp;


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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeValue(this.quarantineId);
        dest.writeString(this.receivingUnit);
        dest.writeString(this.Epc);
        dest.writeString(this.twodimensionno);
        dest.writeString(this.Tid);
        dest.writeString(this.isLegalStatus);
        dest.writeLong(this.timestamp);
    }

    public Long getId() {
        return this.id;
    }

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

    public Long getQuarantineId() {
        return this.quarantineId;
    }

    public void setQuarantineId(Long quarantineId) {
        this.quarantineId = quarantineId;
    }

    public String getReceivingUnit() {
        return this.receivingUnit;
    }

    public void setReceivingUnit(String receivingUnit) {
        this.receivingUnit = receivingUnit;
    }

    public String getEpc() {
        return this.Epc;
    }

    public void setEpc(String Epc) {
        this.Epc = Epc;
    }

    public String getTwodimensionno() {
        return this.twodimensionno;
    }

    public void setTwodimensionno(String twodimensionno) {
        this.twodimensionno = twodimensionno;
    }

    public String getTid() {
        return this.Tid;
    }

    public void setTid(String Tid) {
        this.Tid = Tid;
    }

    public String getIsLegalStatus() {
        return this.isLegalStatus;
    }

    public void setIsLegalStatus(String isLegalStatus) {
        this.isLegalStatus = isLegalStatus;
    }

    public long getTimestamp() {
        return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public QuarantineDetail() {
    }

    protected QuarantineDetail(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.quarantineId = (Long) in.readValue(Long.class.getClassLoader());
        this.receivingUnit = in.readString();
        this.Epc = in.readString();
        this.twodimensionno = in.readString();
        this.Tid = in.readString();
        this.isLegalStatus = in.readString();
        this.timestamp = in.readLong();
    }

    @Generated(hash = 1088178498)
    public QuarantineDetail(Long id, Long quarantineId, String receivingUnit, String Epc,
            String twodimensionno, String Tid, String isLegalStatus, long timestamp) {
        this.id = id;
        this.quarantineId = quarantineId;
        this.receivingUnit = receivingUnit;
        this.Epc = Epc;
        this.twodimensionno = twodimensionno;
        this.Tid = Tid;
        this.isLegalStatus = isLegalStatus;
        this.timestamp = timestamp;
    }

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

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

    @Override
    public String toString() {
        return "QuarantineDetail{" +
                "id=" + id +
                ", quarantineId=" + quarantineId +
                ", receivingUnit='" + receivingUnit + '\'' +
                ", Epc='" + Epc + '\'' +
                ", twodimensionno='" + twodimensionno + '\'' +
                ", Tid='" + Tid + '\'' +
                ", isLegalStatus='" + isLegalStatus + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}
