遍历枚类型的方法: public static EActChannel getEnumByCode(int code) { for (EActChannel enm : EActChannel.values()) { if (code == enm.getCode()) { return enm; } } return null; }
时间: 2024-09-30 09:27:59
遍历枚类型的方法: public static EActChannel getEnumByCode(int code) { for (EActChannel enm : EActChannel.values()) { if (code == enm.getCode()) { return enm; } } return null; }