package org.springblade.modules.app.common.enums;

public enum YesNoEnum {

    /**
     * 是，否类型枚举
     */
    NO(0, "否"),
    YES(1, "是");

    private Integer code;
    private String text;

    YesNoEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static YesNoEnum findByCode(Integer code) {
        for (YesNoEnum closeStateEnum : values()) {
            if (closeStateEnum.getCode().equals(code)) {
                return closeStateEnum;
            }
        }
        return null;
    }

}
