package com.hai.enum_type;

import java.util.Objects;

public enum PayType {

    payType1(1 , "支付宝"),
    payType2(2 , "微信"),
    payType3(3 , "金币"),
    payType4(4 , "汇联通工会卡")
    ;

    private Integer  type;
    private String name;


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

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