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;
|
}
|
}
|