今天接触枚举类型,感觉是C里面应该才有的东西
遍历枚类型的方法:
public static EActChannel getEnumByCode(int code) { for (EActChannel enm : EActChannel.values()) { if (code == enm.getCode()) { return enm; } } return null; }
遍历枚类型的方法:
public static EActChannel getEnumByCode(int code) { for (EActChannel enm : EActChannel.values()) { if (code == enm.getCode()) { return enm; } } return null; }