package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 活动金 - 活动类型
 */
public enum RebateActivityTypeEnum {
    type1(1, "优惠活动"),
    type2(2, "优惠券"),
    ;

    private Integer number;

    private String name;

    RebateActivityTypeEnum(int number, String name) {
        this.number = number;
        this.name = name;
    }

    public static RebateActivityTypeEnum getDataByNumber(Integer number) {
        for (RebateActivityTypeEnum ele : values()) {
            if (Objects.equals(number,ele.getNumber())) {
                return ele;
            }
        }
        return null;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
