xiejun
2023-12-07 85f4b7fa11411d9956870ccdc1fc5c5aa05d2893
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.vci.ubcs.code.enumpack;
 
 
import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.*;
 
/**
 * 用户,角色,部门,职务,岗位,职级
 * @author weidy
 */
 
public enum FrameworkDataLCStatus {
 
 
    /**
     * 启用
     */
    ENABLED(FRAMEWORK_DATA_ENABLED,"启用"),
 
    /**
     * 停用
     */
    DISABLED(FRAMEWORK_DATA_DISABLED,"停用");
 
    /**
     * 枚举值
     */
    private String value;
 
    /**
     * 枚举显示值
     */
    private String text;
    /**
     * 获取枚举值
     * @return 枚举值
     */
 
    public String getValue() {
        return value;
    }
 
    /**
     * 设置枚举值
     * @param value 枚举值
     */
    public void setValue(String value) {
        this.value = value;
    }
 
    /**
     * 获取显示文本
     * @return 显示文本
     */
 
    public String getText() {
        return text;
    }
 
    /**
     * 设置显示文本
     * @param text 显示文本
     */
    public void setText(String text) {
        this.text = text;
    }
 
    /**
     * 枚举内部构造方法
     * @param value 枚举值
     * @param text 显示文本
     */
    private FrameworkDataLCStatus(String value, String text){
        this.value = value;
        this.text = text;
    }
 
    /**
     * 根据枚举的值获取显示文本
     * @param value 枚举值
     * @return 显示文本
     */
    public static String getTextByValue(String value){
        for(FrameworkDataLCStatus eu:FrameworkDataLCStatus.values()){
            if(eu.value.equalsIgnoreCase(value)){
                return eu.text;
            }
        }
        return "";
    }
 
    /**
     * 根据枚举显示文本获取枚举值
     * @param text 显示文本
     * @return 枚举值
     */
    public static String getValueByText(String text){
        for(FrameworkDataLCStatus eu:FrameworkDataLCStatus.values()){
            if(eu.text.equalsIgnoreCase(text)){
                return eu.value;
            }
        }
        return "";
    }
 
}