package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 转账状态
 * @className: TransferAccountsStatus
 * @author: HuRui
 * @date: 2023/10/23
 **/
public enum TransferAccountsStatus {
    status0(0, "不可用"),
    status1(1, "处理中"),
    status2(2, "成功"),
    status3(3, "失败"),
    status4(4, "异常"),
    ;

    private Integer number;

    private String name;

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

    public static TransferAccountsStatus getNameByNumber(Integer number) {
        for (TransferAccountsStatus 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;
    }
}
