package com.xjrsoft.common.enums; import java.util.HashMap; import java.util.Map; /** * @description: 就读方式stduy_status * @author: phoenix * @create: 2023/12/21 11:27 * @Version 1.0 */ public enum StudyStatusEnum { /** * 走读 * */ AttendDaySchool("FB3001", "走读"), /** * 住校 * */ InResidence("FB3002", "住校"), /** * 借宿 * */ PutUpNight("FB3003", "借宿"), /** * 其他 * */ ElseStudyStatus("FB3004", "其他"); final String code; final String value; private static final Map lookup = new HashMap<>(); static { for (StudyStatusEnum s : StudyStatusEnum.values()) { lookup.put(s.getCode(), s.getValue()); } } public String getCode() { return this.code; } public String getValue() { return this.value; } StudyStatusEnum(final String code, final String message) { this.code = code; this.value = message; } public static String fromCode(String code) { return lookup.get(code); } public static String getCode(String value) { for (StudyStatusEnum item : values()) { if (item.getValue().equals(value)) { return item.getCode(); } } return null; } }