package com.hai.enum_type;

import java.util.Objects;

/**
 * 用户卡片类型
 */
public enum UserCardType {

    type1(1, "汇联通工会卡"),
    type2(2, "嗨森逛油卡"),
    ;

    private Integer type;

    private String name;

    UserCardType(Integer type,String name) {
        this.type = type;
        this.name = name;
    }

    public static String getNameByType(Integer type) {
        for (UserCardType ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele.getName();
        }
        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;
    }
}
