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
package cn.wisenergy.model.enums;
/**
* 充值卡状态枚举
*
* @author 86187
*/
public enum CardStatus {
//未使用
NO_USE(1, "未使用"),
//已使用
ALREADY_USED(2, "已使用");
private Integer code;
private String desc;
CardStatus(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public String getDescription() {
return desc;
}
public Integer getCode() {
return code;
}
public static String getNameByCode(Integer code) {
if (null == code) {
return null;
}
for (SceneType type : SceneType.values()) {
if (type.getCode().intValue() == code.intValue()) {
return type.name();
}
}
return null;
}
}