package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 交易订单状态
 * @author hurui
 */
public enum TradeOrderStatusEnum {
    status1(1, "待支付"),
    status2(2, "支付中"),
    status3(3, "支付成功"),
    status4(4, "支付失败"),
    status5(5, "已取消"),
    status6(6, "已退款"),
    ;

    private Integer number;

    private String name;

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

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