ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
package com.vci.mw;
 
/**
 * 富客户端启动模式枚举
 * 
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company: VCI</p>
 * @author xiongchao
 * @time 2017-2-24
 * @version 1.0
 */
public enum LaunchModeEnum {
    Normal("Normal", "普通", 1),
    JNLPWebStart("JNLPWebStart", "JNLPWebStart", 2),
    WebApp("WebApp", "Web项目启动", 3);
    
    private String name = "";
    private String label = "";
    private int intVal = 1;
    
    private LaunchModeEnum(String name, String label, int intVal){
        this.name = name;
        this.label = label;
        this.intVal = intVal;
    }
    
    public static LaunchModeEnum getByName(String name){
        LaunchModeEnum res = getByType(1, name); 
        return res;
    }
    
    public static LaunchModeEnum getByLabel(String label){
        LaunchModeEnum res = getByType(2, label);
        return res;
    }
    
    public static LaunchModeEnum getByIntVal(int intVal){
        LaunchModeEnum res = getByType(3, String.valueOf(intVal));
        return res;
    }
    
    public static LaunchModeEnum getByType(int type, String val){
        LaunchModeEnum[] alls = getAll();
        LaunchModeEnum res = null;
        for(LaunchModeEnum obj : alls){
            if(type == 1 && obj.getName().equalsIgnoreCase(val)){
                res = obj;
                break;
            } else if(type  == 2 && obj.getLabel().equalsIgnoreCase(val)){
                res = obj;
                break;
            } else if(type  == 3 && String.valueOf(obj.getIntVal()).equalsIgnoreCase(val)){
                res = obj;
                break;
            }
        }
        return res;
    }
    
    public static LaunchModeEnum[] getAll(){
        return LaunchModeEnum.values();
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getLabel() {
        return label;
    }
 
    public void setLabel(String label) {
        this.label = label;
    }
 
    public int getIntVal() {
        return intVal;
    }
 
    public void setIntVal(int intVal) {
        this.intVal = intVal;
    }
}