package com.hai.enum_type;

import java.util.Objects;

public enum RechargePayType {

    payType1(1 , "支付宝"),
    payType2(2 , "微信"),
    payType3(3 , "汇联通工会卡"),
    payType4(4 , "银联"),
    payType5(5 , "银联分期")
    ;

    private Integer  type;
    private String name;


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

    public static String getNameByType(Integer type) {
        for (RechargePayType 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;
    }
}
