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

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

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/5/26 4:46 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/5/26 4:46 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SzhtxxPaperInvoiceUsedEnum {


    未使用(0, "未使用"),
    已使用(1, "已使用"),
    ;

    private Integer key;
    private String  desc;

    SzhtxxPaperInvoiceUsedEnum(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 (SzhtxxPaperInvoiceUsedEnum c : SzhtxxPaperInvoiceUsedEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return null;
    }

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

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

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