package com.njcn.advance.enums;

import lombok.Getter;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年04月13日 10:50
 */
@Getter
public enum GovernSchemeEnum {


    UPS(0, "UPS治理方案"),

    AVC(1, "AVC治理方案"),

    AVC_RTS(2, "AVC-RTS治理方案"),

    QUICK(3, "快切开关治理方案"),

    NO_SCHEME(4, "未采取任何治理措施"),
    ;

    private final Integer code;

    private final String message;

    GovernSchemeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据code获取对应的枚举
     */
    public static GovernSchemeEnum getSchemeByCode(int code) {
        for (GovernSchemeEnum governSchemeEnum : GovernSchemeEnum.values()) {
            if (governSchemeEnum.code == code) {
                return governSchemeEnum;
            }
        }
        return GovernSchemeEnum.NO_SCHEME;
    }

}
