public enum RewardTypeEnum {

    FUND_ONLY(1, "佣金"),
    COIN_ONLY(2, "金币"),
    CMS_COIN(3, "佣金|金币");

    private Integer type;
    private String desc;


    private static final Map<Integer, RewardTypeEnum> TYPE_MAP = new HashMap<>(RewardTypeEnum.values().length);

    static {
        for (RewardTypeEnum typeEnum : values()) {
            TYPE_MAP.put(typeEnum.type, typeEnum);
        }
    }


    RewardTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static RewardTypeEnum getByType(Integer type) {
        return TYPE_MAP.get(type);
    }
}

hizengzeng
177 声望10 粉丝

hizengzeng