class KiePMMLRegressionTableRegressionFactory {

    static MethodDeclaration addNumericPredictor(final NumericPredictor numericPredictor,
                                                         final ClassOrInterfaceDeclaration tableTemplate,
                                                         int predictorArity) {
        try {
            templateEvaluate = getFromFileName(KIE_PMML_EVALUATE_METHOD_TEMPLATE_JAVA);
            cloneEvaluate = templateEvaluate.clone();
            ClassOrInterfaceDeclaration evaluateTemplateClass =
                    cloneEvaluate.getClassByName(KIE_PMML_EVALUATE_METHOD_TEMPLATE)
                            .orElseThrow(() -> new RuntimeException(MAIN_CLASS_NOT_FOUND));
            MethodDeclaration methodTemplate;
            if (Objects.equals(1, numericPredictor.getExponent())) {
                methodTemplate = getNumericPredictorWithoutExponentTemplate(numericPredictor, evaluateTemplateClass);
            } else {
                methodTemplate = getNumericPredictorWithExponentTemplate(numericPredictor, evaluateTemplateClass);
            }
            return addMethod(methodTemplate, tableTemplate, "evaluateNumericPredictor" + predictorArity);
        } catch (Exception e) {
            throw new KiePMMLInternalException(String.format("Failed to add NumericPredictor %s",
                                                             numericPredictor.getName()), e);
        }
    }

    private  KiePMMLRegressionTableRegressionFactory();

}