package com.hfkj.sysenum;

import java.util.Objects;

/**
 * @className: TradeSettleTradeType
 * @author: HuRui
 * @date: 2023/8/4
 **/
public enum TradeSettleTradeType {
    type1(1, "交易支付"),
    type2(2, "交易退款"),
    ;

    private Integer number;

    private String name;

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

    public static TradeSettleTradeType getNameByCode(Integer code) {
        for (TradeSettleTradeType ele : values()) {
            if (Objects.equals(code,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;
    }
}
