dengzedong
3 天以前 5665c6d9ff476abd922b1f6a43ea1dac0600cb05
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.iailab.module.model.mcs.pre.enums;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
/**
 * 自动调整 触发规则
 */
@Getter
@AllArgsConstructor
public enum AutoAdjustTriggerRuleEnum {
 
    // 斜率
    SLOPE("slope"),
    // 平均差
    AVERAGE_GAP("average_gap"),
    UNKNOW("unknow");
 
 
    private final String code;
 
    public static AutoAdjustTriggerRuleEnum fromCode(String code) {
        for (AutoAdjustTriggerRuleEnum unit : values()) {
            if (unit.code.equals(code)) {
                return unit;
            }
        }
        return UNKNOW;
    }
}