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 HarmlessDetail extends BaseObservable implements Parcelable {

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

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

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

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

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

    /**
     * 耳标tid
     */
    @Index(name = "HarmlessTid", 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.harmlessId);
        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 getHarmlessId() {
        return this.harmlessId;
    }

    public void setHarmlessId(Long harmlessId) {
        this.harmlessId = harmlessId;
    }

    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 HarmlessDetail() {
    }

    protected HarmlessDetail(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.harmlessId = (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 = 1790410930)
    public HarmlessDetail(Long id, Long harmlessId, String receivingUnit, String Epc,
            String twodimensionno, String Tid, String isLegalStatus, long timestamp) {
        this.id = id;
        this.harmlessId = harmlessId;
        this.receivingUnit = receivingUnit;
        this.Epc = Epc;
        this.twodimensionno = twodimensionno;
        this.Tid = Tid;
        this.isLegalStatus = isLegalStatus;
        this.timestamp = timestamp;
    }

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

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

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


