package com.casic.dcms.model;

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

import androidx.annotation.NonNull;

import java.util.List;

/**
 * Parcelable 是 Android 平台专门为性能优化而设计的序列化机制，通常比 Serializable 快 10 倍左右
 */
public class WellAlarmListBean implements Parcelable {
    private int code;
    private DataBean data;
    private String message;
    private boolean success;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public WellAlarmListBean() {

    }

    protected WellAlarmListBean(Parcel in) {
        code = in.readInt();
        data = in.readParcelable(DataBean.class.getClassLoader());
        message = in.readString();
        success = in.readByte() != 0;
    }

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

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

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

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeParcelable(data, flags);
        dest.writeString(message);
        dest.writeByte((byte) (success ? 1 : 0));
    }

    public static class DataBean implements Parcelable {

        private int total;
        private List<RowsBean> rows;

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public List<RowsBean> getRows() {
            return rows;
        }

        public void setRows(List<RowsBean> rows) {
            this.rows = rows;
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            total = in.readInt();
            rows = in.createTypedArrayList(RowsBean.CREATOR);
        }

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

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

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

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(total);
            dest.writeTypedList(rows);
        }

        public static class RowsBean implements Parcelable {
            /**
             * alarmContent : 1
             * deptName : 崇仁县城管局
             * jobStatus : 0
             * alarmContentName : 井盖开盖报警
             * wellCode : GX_WSD_4107_HLDD037
             * alarmTime : 2019-06-24 11:47:10
             * deptid : 24
             * alarmTypeName : 一次报警
             * alarmMessage : 井盖开盖报警
             * staff : 超级管理员
             * deviceId : 1356438698347016196
             * jobId : 1232266
             * jobStatusName : 待处理
             * alarmType : 1
             * alarmValue : --
             * devcode : 412020110003
             * statusName : 正在报警
             * alarmLevel :
             * tel : 18200000000
             * id : 11409
             * wellId : 36962
             * position : 活力大道
             * status : 1
             */

            private int alarmContent;
            private String deptName;
            private String jobStatus;
            private String alarmContentName;
            private String wellCode;
            private String alarmTime;
            private String deptid;
            private String alarmTypeName;
            private String alarmMessage;
            private String staff;
            private String deviceId;
            private String jobId;
            private String jobStatusName;
            private String alarmType;
            private String alarmValue;
            private String devcode;
            private String statusName;
            private String alarmLevel;
            private String tel;
            private String id;
            private String wellId;
            private String position;
            private String status;

            public int getAlarmContent() {
                return alarmContent;
            }

            public void setAlarmContent(int alarmContent) {
                this.alarmContent = alarmContent;
            }

            public String getDeptName() {
                return deptName;
            }

            public void setDeptName(String deptName) {
                this.deptName = deptName;
            }

            public String getJobStatus() {
                return jobStatus;
            }

            public void setJobStatus(String jobStatus) {
                this.jobStatus = jobStatus;
            }

            public String getAlarmContentName() {
                return alarmContentName;
            }

            public void setAlarmContentName(String alarmContentName) {
                this.alarmContentName = alarmContentName;
            }

            public String getWellCode() {
                return wellCode;
            }

            public void setWellCode(String wellCode) {
                this.wellCode = wellCode;
            }

            public String getAlarmTime() {
                return alarmTime;
            }

            public void setAlarmTime(String alarmTime) {
                this.alarmTime = alarmTime;
            }

            public String getDeptid() {
                return deptid;
            }

            public void setDeptid(String deptid) {
                this.deptid = deptid;
            }

            public String getAlarmTypeName() {
                return alarmTypeName;
            }

            public void setAlarmTypeName(String alarmTypeName) {
                this.alarmTypeName = alarmTypeName;
            }

            public String getAlarmMessage() {
                return alarmMessage;
            }

            public void setAlarmMessage(String alarmMessage) {
                this.alarmMessage = alarmMessage;
            }

            public String getStaff() {
                return staff;
            }

            public void setStaff(String staff) {
                this.staff = staff;
            }

            public String getDeviceId() {
                return deviceId;
            }

            public void setDeviceId(String deviceId) {
                this.deviceId = deviceId;
            }

            public String getJobId() {
                return jobId;
            }

            public void setJobId(String jobId) {
                this.jobId = jobId;
            }

            public String getJobStatusName() {
                return jobStatusName;
            }

            public void setJobStatusName(String jobStatusName) {
                this.jobStatusName = jobStatusName;
            }

            public String getAlarmType() {
                return alarmType;
            }

            public void setAlarmType(String alarmType) {
                this.alarmType = alarmType;
            }

            public String getAlarmValue() {
                return alarmValue;
            }

            public void setAlarmValue(String alarmValue) {
                this.alarmValue = alarmValue;
            }

            public String getDevcode() {
                return devcode;
            }

            public void setDevcode(String devcode) {
                this.devcode = devcode;
            }

            public String getStatusName() {
                return statusName;
            }

            public void setStatusName(String statusName) {
                this.statusName = statusName;
            }

            public String getAlarmLevel() {
                return alarmLevel;
            }

            public void setAlarmLevel(String alarmLevel) {
                this.alarmLevel = alarmLevel;
            }

            public String getTel() {
                return tel;
            }

            public void setTel(String tel) {
                this.tel = tel;
            }

            public String getId() {
                return id;
            }

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

            public String getWellId() {
                return wellId;
            }

            public void setWellId(String wellId) {
                this.wellId = wellId;
            }

            public String getPosition() {
                return position;
            }

            public void setPosition(String position) {
                this.position = position;
            }

            public String getStatus() {
                return status;
            }

            public void setStatus(String status) {
                this.status = status;
            }

            public RowsBean() {
            }

            protected RowsBean(Parcel in) {
                alarmContent = in.readInt();
                deptName = in.readString();
                jobStatus = in.readString();
                alarmContentName = in.readString();
                wellCode = in.readString();
                alarmTime = in.readString();
                deptid = in.readString();
                alarmTypeName = in.readString();
                alarmMessage = in.readString();
                staff = in.readString();
                deviceId = in.readString();
                jobId = in.readString();
                jobStatusName = in.readString();
                alarmType = in.readString();
                alarmValue = in.readString();
                devcode = in.readString();
                statusName = in.readString();
                alarmLevel = in.readString();
                tel = in.readString();
                id = in.readString();
                wellId = in.readString();
                position = in.readString();
                status = in.readString();
            }

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

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

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

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(alarmContent);
                dest.writeString(deptName);
                dest.writeString(jobStatus);
                dest.writeString(alarmContentName);
                dest.writeString(wellCode);
                dest.writeString(alarmTime);
                dest.writeString(deptid);
                dest.writeString(alarmTypeName);
                dest.writeString(alarmMessage);
                dest.writeString(staff);
                dest.writeString(deviceId);
                dest.writeString(jobId);
                dest.writeString(jobStatusName);
                dest.writeString(alarmType);
                dest.writeString(alarmValue);
                dest.writeString(devcode);
                dest.writeString(statusName);
                dest.writeString(alarmLevel);
                dest.writeString(tel);
                dest.writeString(id);
                dest.writeString(wellId);
                dest.writeString(position);
                dest.writeString(status);
            }
        }
    }
}
