package com.iailab.netsdk.lib.enumeration; public enum EM_CURRENT_STATE_TYPE { EM_CURRENT_STATE_UNKNOWN(0, "电æµçŠ¶æ€æœªçŸ¥"), EM_CURRENT_STATE_OVER_CURRENT(1, "电æµè¿‡è½½"), // 电æµè¿‡è½½ EM_CURRENT_STATE_NORMAL(2, "电æµæ£å¸¸"), // 电æµæ£å¸¸ EM_CURRENT_STATE_UNDER_CURRENT(3, "电æºæ¬ æµ"); // 电æºæ¬ æµ private int value; private String note; private EM_CURRENT_STATE_TYPE(int givenValue, String note) { this.value = givenValue; this.note = note; } public String getNote() { return note; } public int getValue() { return value; } public static String getNoteByValue(int givenValue) { for (EM_CURRENT_STATE_TYPE enumType : EM_CURRENT_STATE_TYPE.values()) { if (givenValue == enumType.getValue()) { return enumType.getNote(); } } return null; } public static int getValueByNote(String givenNote) { for (EM_CURRENT_STATE_TYPE enumType : EM_CURRENT_STATE_TYPE.values()) { if (givenNote.equals(enumType.getNote())) { return enumType.getValue(); } } return -1; } }