package cn.superdesk.uniorder.executor.scheduler.kafka._inner._constants.enums;

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

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/5/23 12:07 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/5/23 12:07 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum AccountingScoreCustomerKafkaEventEnum {

    基于对账单触发_检验与更新对账单字段开票申请状态("checkAndUpdateAccountingOrderFieldInvoiceStatusEvent", "基于对账单触发_检验与更新对账单字段开票申请状态"),

    ;

    /**
     * eventKey
     */
    private String key;
    /**
     * eventDesc
     */
    private String desc;

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

    public String getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

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

        return "未知事件";
    }

    private static final Map<String, AccountingScoreCustomerKafkaEventEnum> LOOKUP = new HashMap<>();

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

    public static AccountingScoreCustomerKafkaEventEnum get(String key) {
        return LOOKUP.get(key);
    }
}
