CardStatus.java 812 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
package cn.wisenergy.model.enums;

/**
 * 充值卡状态枚举
 *
 * @author 86187
 */

public enum CardStatus {
    //未使用
licc's avatar
licc committed
11
    NO_USE(0, "未使用"),
12 13

    //已使用
licc's avatar
licc committed
14
    ALREADY_USED(1, "已使用");
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
    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;
    }
}