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;
|
}
|
}
|