class TaskParametersUtils {

    public static AbstractParameters getParameters(String taskType, String parameter) {
        TaskType anEnum = EnumUtils.getEnum(TaskType.class, taskType);
        if (anEnum == null) {
            logger.error("not support task type: {}", taskType);
            return null;
        }
        switch (anEnum) {
            case SUB_PROCESS:
                return JSONUtils.parseObject(parameter, SubProcessParameters.class);
            case SHELL:
            case WATERDROP:
                return JSONUtils.parseObject(parameter, ShellParameters.class);
            case PROCEDURE:
                return JSONUtils.parseObject(parameter, ProcedureParameters.class);
            case SQL:
                return JSONUtils.parseObject(parameter, SqlParameters.class);
            case MR:
                return JSONUtils.parseObject(parameter, MapreduceParameters.class);
            case SPARK:
                return JSONUtils.parseObject(parameter, SparkParameters.class);
            case PYTHON:
                return JSONUtils.parseObject(parameter, PythonParameters.class);
            case DEPENDENT:
                return JSONUtils.parseObject(parameter, DependentParameters.class);
            case FLINK:
                return JSONUtils.parseObject(parameter, FlinkParameters.class);
            case HTTP:
                return JSONUtils.parseObject(parameter, HttpParameters.class);
            case DATAX:
                return JSONUtils.parseObject(parameter, DataxParameters.class);
            case CONDITIONS:
                return JSONUtils.parseObject(parameter, ConditionsParameters.class);
            case SQOOP:
                return JSONUtils.parseObject(parameter, SqoopParameters.class);
            default:
                return null;
        }

    }

    private  TaskParametersUtils();

}