package com.bbitcn.silk.model;

import android.view.View;
import android.widget.CompoundButton;

/**
 * @Author：DuanKaiji
 * @Date：2024年3月28日 09:47:35
 * @Declaration：设置单项内容-配置界面用
 */
public class Set {
    /**
     * 设置项
     */
    private String title;
    /**
     * 设置内容
     */
    private String detail;
    /**
     * 点击事件
     */
    private View.OnClickListener onClickListener;
    /**
     * 默认开关
     */
    private boolean isChecked;
    /**
     * 开关事件
     *  为空时不显示开关
     */
    private CompoundButton.OnCheckedChangeListener onCheckedChangeListener;

    /**
     * 设置标题和事件
     */
    public Set(String title, View.OnClickListener onClickListener) {
        this.title = title;
        this.onClickListener = onClickListener;
    }
    /**
     * 设置标题和事件
     */
    public Set(String title, String detail) {
        this.title = title;
        this.detail = detail;
    }

    /**
     * 设置标题、细节和事件
     */
    public Set(String title, String detail, View.OnClickListener onClickListener) {
        this.title = title;
        this.detail = detail;
        this.onClickListener = onClickListener;
    }

    /**
     * 设置标题、开关默认状态和开关事件
     */
    public Set(String title, boolean isChecked, CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.title = title;
        this.isChecked = isChecked;
        this.onCheckedChangeListener = onCheckedChangeListener;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public CompoundButton.OnCheckedChangeListener getOnCheckedChangeListener() {
        return onCheckedChangeListener;
    }

    public void setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.onCheckedChangeListener = onCheckedChangeListener;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public View.OnClickListener getOnClickListener() {
        return onClickListener;
    }

    public void setOnClickListener(View.OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }
}
