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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| package com.qianwen.core.coderule.constant.enums;
|
|
| public enum ElementTypeEnum {
| SEQUENCE(0, "流水号"),
| CONSTANT(1, "常量"),
| DATE(2, "日期字段"),
| NUMBER(3, "数值字段"),
| DROPDOWN(4, "下拉列表"),
| BASE_DATA(5, "基础资料"),
| BASE_DATA_PROPERTY(6, "基础资料属性"),
| TEXT(7, "文本");
|
| private final Integer type;
| private final String description;
|
| ElementTypeEnum(final Integer type, final String description) {
| this.type = type;
| this.description = description;
| }
|
| public Integer getType() {
| return this.type;
| }
|
| public String getDescription() {
| return this.description;
| }
|
| public static ElementTypeEnum of(Integer elementType) {
| if (elementType == null) {
| return null;
| }
| ElementTypeEnum[] values = values();
| for (ElementTypeEnum elementEnum : values) {
| if (elementEnum.type.equals(elementType)) {
| return elementEnum;
| }
| }
| return null;
| }
| }
|
|