package org.fanzone.lang;
public enum ThinType {
/*通过键值的方式存储*/
BI("商务智能",0), UI("人机交互",1), Unknow("未知",2);
private String name;
private Integer value;
private ThinType(String name, Integer value){
this.name = name;
this.value = value;
}
@Override
public String toString() {
return this.name;
}
public Integer getValue() {
return this.value;
}
/*通过此方法返回类型*/
public static ThinType valueOf(Integer value){
ThinType[] ttValues = ThinType.values();
for(ThinType tt : ttValues){
if(tt.value == value){
return tt;
}
}
return Unknow;
}
}
/**测试*/
package org.mars.level;
public class RunKen {
@SuppressWarnings("static-access")
public static void main(String[] args){
BizAspect ba = new BizAspect();
ba.setThinType(ThinType.BI);
System.out.println(ba.getThinType().valueOf(5).toString());
}
}