public enum testEnum {
TEST1("11","11"),
TEST1("22","22");
/**
* @Description: 根据code得到对应的msg,查不到返回null
* @Author: 王乾
* @Date: 2022/2/7 14:28
* @param code:
**/
public static String getMsgByCode(int code){
for (FlsxZlxmbgTlBglyEnum bglyEnum : FlsxZlxmbgTlBglyEnum.values()) {
if (bglyEnum.getCode().equals(code)){
return bglyEnum.msg;
}
}
return null;
}
private String code;
private String msg;
public static NewsTypeEnum[] getAllEnum(){
NewsTypeEnum[] values = NewsTypeEnum.values();
return values;
}
}