package com.hai.enum_type;

import java.util.Objects;

/**
 * 子订单商品类型
 * @author hurui
 */
public enum OrderChildGoodsTypeEnum {
    type1(1 , "卡券"),
    type2(2 , "金币充值"),
    type3(3 , "加油服务"),
    type4(4 , "KFC"),
    type5(5 , "电影票"),
    type6(6 , "话费充值"),
    type7(7 , "优惠券包"),
    type8(8 , "贵州汇联通充值"),
            ;

    private Integer type;
    private String name;

    OrderChildGoodsTypeEnum(int type , String name) {
        this.type = type;
        this.name = name;
    }

    public static OrderChildGoodsTypeEnum getDataByType(Integer type) {
        for (OrderChildGoodsTypeEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele;
        }
        return null;
    }


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

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