package com.phlx.wool.entity;

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

import androidx.databinding.BaseObservable;

import com.google.gson.annotations.SerializedName;

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

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

    @Id(autoincrement = false)
    private Long id;

    /**
     * 兽医代码
     */
    @SerializedName("personid")
    private String veterinaryCode;

    /**
     * 兽医名称
     */
    @SerializedName("personname")
    private String veterinaryName;

    /**
     * 兽医电话
     */
    @SerializedName("phone")
    private String veterinaryPhone;

    /**
     * 时间戳
     */
    @SerializedName("inputTime")
    private long timestamp;



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

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

    public String getVeterinaryCode() {
        return this.veterinaryCode;
    }

    public void setVeterinaryCode(String veterinaryCode) {
        this.veterinaryCode = veterinaryCode;
    }

    public String getVeterinaryName() {
        return this.veterinaryName;
    }

    public void setVeterinaryName(String veterinaryName) {
        this.veterinaryName = veterinaryName;
    }

    public String getVeterinaryPhone() {
        return this.veterinaryPhone;
    }

    public void setVeterinaryPhone(String veterinaryPhone) {
        this.veterinaryPhone = veterinaryPhone;
    }

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

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


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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.veterinaryCode);
        dest.writeString(this.veterinaryName);
        dest.writeString(this.veterinaryPhone);
        dest.writeLong(this.timestamp);
    }

    protected Veterinary(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.veterinaryCode = in.readString();
        this.veterinaryName = in.readString();
        this.veterinaryPhone = in.readString();
        this.timestamp = in.readLong();
    }

    @Generated(hash = 1680592785)
    public Veterinary(Long id, String veterinaryCode, String veterinaryName,
            String veterinaryPhone, long timestamp) {
        this.id = id;
        this.veterinaryCode = veterinaryCode;
        this.veterinaryName = veterinaryName;
        this.veterinaryPhone = veterinaryPhone;
        this.timestamp = timestamp;
    }

    @Generated(hash = 1188226452)
    public Veterinary() {
    }

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

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

    @Override
    public String toString() {
        return "Veterinary{" +
                "id=" + id +
                ", veterinaryCode='" + veterinaryCode + '\'' +
                ", veterinaryName='" + veterinaryName + '\'' +
                ", veterinaryPhone='" + veterinaryPhone + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}
