标签:
public enum CommonStatus {
NORMAL(1), PAUSE(2), DELETE(3);
private int value;
private CommonStatus(int v) {
this.value = v;
}
public int getValue() {
return value;
}
public static String getName(int v) {
switch (v) {
case 1:
return "正常";
case 2:
return "停用";
case 3:
return "删除";
default:
return "";
}
}
public static String getName(CommonStatus s) {
return getName(s.getValue());
}
}
标签:
原文地址:http://www.cnblogs.com/baobaodaren/p/5910228.html