forked from dyf/fys-Multi-tenant
46 lines
963 B
Java
46 lines
963 B
Java
package com.fuyuanshen.web.enums;
|
|
|
|
/**
|
|
* @author: 默苍璃
|
|
* @date: 2025-08-0114:30
|
|
*/
|
|
public enum LightModeEnum6170 {
|
|
|
|
OFF(0, "关灯"),
|
|
HIGH_BEAM(1, "强光模式"),
|
|
LOW_BEAM(2, "弱光模式"),
|
|
STROBE(3, "爆闪模式"),
|
|
FLOOD(4, "泛光模式"),
|
|
|
|
UNKNOWN(-1, "未知的灯光模式");
|
|
|
|
|
|
private final int code;
|
|
private final String description;
|
|
|
|
|
|
LightModeEnum6170(int code, String description) {
|
|
this.code = code;
|
|
this.description = description;
|
|
}
|
|
|
|
public int getCode() {
|
|
return code;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public static LightModeEnum6170 fromCode(int code) {
|
|
for (LightModeEnum6170 mode : values()) {
|
|
if (mode.getCode() == code) {
|
|
return mode;
|
|
}
|
|
}
|
|
// throw new IllegalArgumentException("未知的灯光模式代码: " + code);
|
|
return UNKNOWN;
|
|
}
|
|
|
|
}
|