ANDON枚举

yun-zuoyi
柯裕 6 years ago
parent ba368a0327
commit 593a062e9f

@ -147,4 +147,43 @@ public class AndonEnumUtil {
return description; return description;
} }
} }
/**
*
* 1 - 2 - 3 - 4 -
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ALARM_PRIORITY{
FIRST(1,"一级"),
SECOND(2,"二级"),
THIRD(3,"三级"),
FOURTH(4,"四级");
private int value;
private String description;
ALARM_PRIORITY(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
} }

Loading…
Cancel
Save