package com.fxy.detection.bean;

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

import java.util.ArrayList;
import java.util.List;

public class BtnInfoBean implements Parcelable{
    private String key = "";
    private String value = "";
    private String txt = "";
    private String tip = "";
    private List<NeedPhotoBean> need_photos = new ArrayList<>();
    private Boolean checked = false;

    public BtnInfoBean(){

    }


    protected BtnInfoBean(Parcel in) {
        key = in.readString();
        value = in.readString();
        txt = in.readString();
        tip = in.readString();
        need_photos = in.createTypedArrayList(NeedPhotoBean.CREATOR);
        byte tmpChecked = in.readByte();
        checked = tmpChecked == 0 ? null : tmpChecked == 1;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(key);
        dest.writeString(value);
        dest.writeString(txt);
        dest.writeString(tip);
        dest.writeTypedList(need_photos);
        dest.writeByte((byte) (checked == null ? 0 : checked ? 1 : 2));
    }

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

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

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

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getTxt() {
        return txt;
    }

    public void setTxt(String txt) {
        this.txt = txt;
    }

    public String getTip() {
        return tip;
    }

    public BtnInfoBean setTip(String tip) {
        this.tip = tip;
        return this;
    }

    public List<NeedPhotoBean> getNeedPhotos() {
        return need_photos;
    }

    public BtnInfoBean setNeedPhotos(List<NeedPhotoBean> need_photos) {
        this.need_photos = need_photos;
        return this;
    }

    public Boolean getChecked() {
        return checked;
    }

    public BtnInfoBean setChecked(Boolean checked) {
        this.checked = checked;
        return this;
    }
}
