1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| package com.ots.common.enums;
| import lombok.Getter;
| import java.util.Objects;
| @Getter
| public enum ReportTypeEnum {
| Brief("Brief", "简易版"), Complete("Complete", "完整版"), SAQ("SAQ", "SAQ报告"), RuiLin("RuiLin", "睿邻报告"), CAQ("CAQ", "CAQ报告"),
| JAQ("JAQ","JAQ报告"),MAQ("MAQ", "MAQ报告"),MAQV2("MAQV2", "MAQV2报告"),PAQ("PAQ", "PAQ报告"),MAQIAR("MAQIAR", "MAQIAR报告"),MAQTR("MAQTR", "MAQTR报告");
| private final String code;
| private final String message;
| ReportTypeEnum(String code, String message) {
| this.code = code;
| this.message = message;
| }
| public static ReportTypeEnum codeOf(String code) {
| for (ReportTypeEnum xxxEnum : values()) {
| //MAQIAR特殊处理
| if (code.contains(MAQIAR.code)) {
| return MAQIAR;
| }
| if (Objects.equals(xxxEnum.getCode(), code)) {
| return xxxEnum;
| }
| }
| throw new RuntimeException("The Report is not supported!");
| }
| }
|
|