package com.iailab.netsdk.lib.enumeration; /** * @author 421657 * @description 报è¦ä½¿èƒ½æŽ§åˆ¶æ–¹å¼æžšä¸¾ç±»åž‹ * @origin autoTool * @date 2023/11/01 20:42:35 */ public enum EM_CTRL_ENABLE { /** * ä¸æŽ§åˆ¶ä½¿èƒ½ */ EM_CTRL_NORMAL(0, "ä¸æŽ§åˆ¶ä½¿èƒ½"), /** * 总是使能 */ EM_CTRL_ALWAYS_EN(1, "总是使能"), /** * æ—è·¯ */ EM_CTRL_ONCE_DIS(2, "æ—è·¯"), /** * 移除 */ EM_CTRL_ALWAYS_DIS(3, "移除"), /** * 枚举类型总数 */ EM_CTRL_NU(4, "枚举类型总数"); private int value; private String note; public String getNote() { return note; } public int getValue() { return value; } EM_CTRL_ENABLE(int givenValue, String note) { this.value = givenValue; this.note = note; } public static String getNoteByValue(int givenValue) { for (EM_CTRL_ENABLE enumType : EM_CTRL_ENABLE.values()) { if (givenValue == enumType.getValue()) { return enumType.getNote(); } } return null; } public static int getValueByNote(String givenNote) { for (EM_CTRL_ENABLE enumType : EM_CTRL_ENABLE.values()) { if (givenNote.equals(enumType.getNote())) { return enumType.getValue(); } } return -1; } public static EM_CTRL_ENABLE getEnum(int value) { for (EM_CTRL_ENABLE e : EM_CTRL_ENABLE.values()) { if (e.getValue() == value) { return e; } } return EM_CTRL_ENABLE.EM_CTRL_NORMAL; } }