package com.engine.htxc.eseal.responseaction.num;

import com.engine.htxc.eseal.type.IColumnType;
import com.engine.integration.util.StringUtils;

/**
 * @author K1810015
 * @version 1.0.0
 * @ClassName EsealClassType.java
 * @createTime 2022年06月28日 23:06:00
 */
public enum EsealClassType implements IColumnType {


    CONTRACTOTCDERTRA("uf_otcdertra","com.engine.htxc.eseal.responseaction.business.contract.service.EsealContractReq"),
    CONTRACTHTQC("uf_htqc","com.engine.htxc.eseal.responseaction.business.contract.service.EsealContractReq"),
    OTHER("OTHER","-1");
    private final String key;
    private final String value;

    private EsealClassType(final String key, final String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static EsealClassType where(String key){
        if(StringUtils.isBlank(key)){
            return OTHER;
        }
        EsealClassType[] value= EsealClassType.values();
        for(EsealClassType esealClassType:value){
            if(key.equals(esealClassType.getKey())){
                return esealClassType;
            }
        }
        return OTHER;
    }
}
