public enum DictType {
系统皮肤(10), 病人类型(20), 性别(30), 人员性质(40), 职业(50), 区域(60), 民族(70), 国籍(80), 客户来源(90), 物品分类(100), 物品单位(110), 外加工地点(120), 外加工物品类型(
130), 收费项目单位(140), 公告类型(142);
private int enumValue;
public int getEnumValue() {
return enumValue;
}
DictType(int value) {
this.enumValue = value;
}
};
/**
* 根据key取入出库类型
*
* @param value
* @return
*/
public static String getChargeTypeByKey(String key) {
CommonEnumType.ChargeType[] ists = CommonEnumType.ChargeType.values();
for (ChargeType ist : ists) {
if (ist.getKey() == key) {
return ist.name();
}
}
return null;
}
枚举类型与静态方法实现
本文介绍了一种使用枚举类型存储系统配置的方式,并提供了一个根据键获取对应的枚举值的静态方法实现。该方法适用于多种场景,如系统皮肤、病人类型等,通过枚举值映射实现了灵活的配置管理。
2096

被折叠的 条评论
为什么被折叠?



