package cn.superdesk.uniorder.common.enums.thirdpart.szhtxx.electronicInvoice;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 邮件状态:0-未发送;1-已发送;
 * @Author: linjinyu
 * @CreateDate: 2022/3/18 11:54 上午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/18 11:54 上午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum {

    不发送(-1, "/"),
    未发送(0, "未发送"),
    已发送(1, "已发送"),
    ;

    private Integer key;
    private String desc;

    SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public Integer getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(Integer key) {
        for (SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum c : SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return null;
    }

    private static final Map<Integer, SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum> LOOKUP = new HashMap<>();

    static {
        for (SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum s : EnumSet.allOf(SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum.class)) {
            LOOKUP.put(s.getKey(), s);
        }
    }

    public static SzhtxxElectronicInvoiceFptxxSentEmailStatusEnum get(Integer key) {
        return LOOKUP.get(key);
    }
}
