| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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<String, String> 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;
- }
- }
|