/**
* @Author 庭前云落
* @Date 2021/9/17 14:38
* @Description 附件码值
*/
public enum MultiMediaInfoEnum {
/**
* 信件状态码值(1信访,2线索,3案件,4审理)
*/
BASIC_ORIGINAL_LATTER("0101", "原信"),
BASIC_OTHERS_MULTIMEDIAINFO("0102", "信访其他附件"),
DIS_MATERIA("0201", "线索材料"),
DIS_HANDLING_REPORT("0202", "线索办理报告"),
DIS_OTHERS_MULTIMEDIAINFO("0203", "线索其他附件"),
CASE_MATERIA("0301", "证据材料"),
CASE_PROPERTY_REPORT_INVOLVED("0302", "涉案财物报告"),
CASE_APPROVAL("0303", "立案审批表"),
CASE_DECISION("0304", "立案决定书"),
CASE_OTHERS_MULTIMEDIAINFO("0305", "案件其他附件"),
CASE_HEAR_REPORT("0401", "审理报告"),
CASE_HEAR_PUNISHMENT("0402", "处分决定"),
CASE_HEAR_OTHERS_MULTIMEDIAINFO("0403", "审理其他附件");
private final String code;
private final String info;
MultiMediaInfoEnum(String code, String info) {
this.code = code;
this.info = info;
}
public String getCode() {
return code;
}
public String getInfo() {
return info;
}
public static Map<String, String> toMap() {
Map<String, String> map = new HashMap<String, String>();
for (MultiMediaInfoEnum multiMediaInfoEnum : MultiMediaInfoEnum.values()) {
map.put(multiMediaInfoEnum.getCode(), multiMediaInfoEnum.getInfo());
}
return map;
}
public static String getInfoByCode(String code) {
String result = null;
Map<String, String> multiMap = MultiMediaInfoEnum.toMap();
for (Map.Entry<String, String> stringObjectEntry : multiMap.entrySet()) {
if (stringObjectEntry.getKey().equals(code)) {
result = stringObjectEntry.getValue();
}
}
return result;
}
}
枚举里面自定义方法(根据code返回Info)
最新推荐文章于 2023-11-23 16:00:34 发布