package com.prolog.eis.enums.base;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SwitchEnum {

    OFF("0", "关闭"),

    OPEN("1", "开启"),
    ;

    /**
     * 是否锁定(0:不锁定  1:锁定)
     */
    private final String code;

    /**
     * 描述
     */
    private final String describe;


    public static SwitchEnum getByCode(Integer code) {
        SwitchEnum statusEnum = null;

        for (SwitchEnum value : values()) {
            if (value.getCode().equals(code)) {
                statusEnum = value;
            }
        }
        return statusEnum;
    }
}
