package com.friday.operation.api.keepalive.constant.taieoc;

public enum ProcessFileTypeEnum {
    EXECUTE("Execute","可执行文件"),
    CODE("code","代码包"),
    MODULE("module","组件");

    private String key;
    private String desc;
    private ProcessFileTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }
    public String getKey() {
        return key;
    }
    public String getDesc() {
        return desc;
    }

    public static String getDescByKey(String key){
        for (ProcessFileTypeEnum fileTypeEnum : ProcessFileTypeEnum.values()) {
            if (fileTypeEnum.getKey().equals(key)) {
                return fileTypeEnum.getDesc();
            }
        }
        return null;
    }
    public static String getKeyByDesc(String desc){
        for (ProcessFileTypeEnum fileTypeEnum : ProcessFileTypeEnum.values()) {
            if (fileTypeEnum.getDesc().equals(desc)) {
                return fileTypeEnum.getKey();
            }
        }
        return null;
    }
}
