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 Variety extends BaseObservable implements Parcelable {
    @Id(autoincrement = false)
    private Long id;
    /**
     * 品种代码
     */
    @SerializedName("ancestryid")
    private String VarietyCode;

    /**
     * 品种名称
     */
    @SerializedName("ancestryname")
    private String VarietyName;



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

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

    public String getVarietyCode() {
        return this.VarietyCode;
    }

    public void setVarietyCode(String VarietyCode) {
        this.VarietyCode = VarietyCode;
    }

    public String getVarietyName() {
        return this.VarietyName;
    }

    public void setVarietyName(String VarietyName) {
        this.VarietyName = VarietyName;
    }

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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.VarietyCode);
        dest.writeString(this.VarietyName);
    }

    protected Variety(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.VarietyCode = in.readString();
        this.VarietyName = in.readString();
    }

    @Generated(hash = 1906955683)
    public Variety(Long id, String VarietyCode, String VarietyName) {
        this.id = id;
        this.VarietyCode = VarietyCode;
        this.VarietyName = VarietyName;
    }

    @Generated(hash = 1163626520)
    public Variety() {
    }

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

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

    @Override
    public String toString() {
        return "Variety{" +
                "id=" + id +
                ", VarietyCode='" + VarietyCode + '\'' +
                ", VarietyName='" + VarietyName + '\'' +
                '}';
    }
}
