#
Junjie
9 天以前 dc3f9cc91759823ce59486f19b138be4b296a0f1
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.zy.ai.domain.autotune;
 
public enum AutoTuneTriggerType {
    AUTO("auto"),
    MANUAL("manual"),
    ROLLBACK("rollback");
 
    private final String code;
 
    AutoTuneTriggerType(String code) {
        this.code = code;
    }
 
    public String getCode() {
        return code;
    }
 
    public static String normalize(String code) {
        if (code == null || code.trim().isEmpty()) {
            return MANUAL.code;
        }
        String normalizedCode = code.trim();
        for (AutoTuneTriggerType triggerType : values()) {
            if (triggerType.code.equals(normalizedCode)) {
                return normalizedCode;
            }
        }
        return MANUAL.code;
    }
}