| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- *
- */
- package com.xcgl.dataview.entity;
- /**
- * @author xzx
- *
- */
- public enum DeviceStatus {
- NORMAL(0, "正常"), ABNORMAL(1, "报警"), ABNORMAL_SHANGXIAN(11,"超出上限"), ABNORMAL_XIAXIAN(12, "低于下限"), OFFLINE(21,"离线");
-
- private int index;
-
- private String text;
-
- public static DeviceStatus getDeviceStatus(int index) {
- for(DeviceStatus ds :DeviceStatus.values()) {
- if(ds.getIndex() == index) {
- return ds;
- }
- }
- return null;
- }
- private DeviceStatus(int index, String text) {
- this.index = index;
- this.text = text;
- }
- public int getIndex() {
- return index;
- }
- public void setIndex(int index) {
- this.index = index;
- }
- public String getText() {
- return text;
- }
- public void setText(String text) {
- this.text = text;
- }
-
- public String toString() {
- return getText();
- }
-
- }
|