package com.fxy.bean.realm;

import android.os.Parcel;
import android.os.Parcelable;
import io.realm.RealmObject;

/**
 *  项目名称：大货
 *  类描述：扫描设置数据表（缓存本地数据库）
 *  创建人：桂林
 *  创建时间：2021/01/29
 *  修改备注:
 *  修改时间
 */
public class ScanSetupModel  extends RealmObject implements Parcelable {

    //表ID
    private String id;
    private String device_name;
    private String action;
    private String data_name;
    private Integer is_broadcast = 1 ;
    private String status_name = "";
    private String action_stop = "";

    protected ScanSetupModel(Parcel in) {
        id = in.readString();
        device_name = in.readString();
        action = in.readString();
        data_name = in.readString();
        if (in.readByte() == 0) {
            is_broadcast = null;
        } else {
            is_broadcast = in.readInt();
        }
        status_name = in.readString();
        action_stop = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(device_name);
        dest.writeString(action);
        dest.writeString(data_name);
        if (is_broadcast == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(is_broadcast);
        }
        dest.writeString(status_name);
        dest.writeString(action_stop);
    }

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

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

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


    public ScanSetupModel() {
    }
}
