class KiePMMLPredicateFactory {

    static void setSimpleSetPredicateConstructor(final String generatedClassName,
                                                 final String predicateName,
                                                 final ConstructorDeclaration constructorDeclaration,
                                                 final ARRAY_TYPE arrayType,
                                                 final IN_NOTIN inNotIn,
                                                 final List<Object> values) {
        setConstructorSuperNameInvocation(generatedClassName, constructorDeclaration, predicateName);
        final BlockStmt body = constructorDeclaration.getBody();
        final ExplicitConstructorInvocationStmt superStatement = CommonCodegenUtils.getExplicitConstructorInvocationStmt(body)
                .orElseThrow(() -> new KiePMMLException(String.format(MISSING_CONSTRUCTOR_IN_BODY, body)));
        CommonCodegenUtils.setExplicitConstructorInvocationArgument(superStatement, "arrayType", arrayType.getClass().getCanonicalName() + "." + arrayType.name());
        CommonCodegenUtils.setExplicitConstructorInvocationArgument(superStatement, "inNotIn", inNotIn.getClass().getCanonicalName() + "." + inNotIn.name());
        AssignExpr assignExpr = CommonCodegenUtils
                .getAssignExpression(body, "values")
                .orElseThrow(() -> new KiePMMLException(String.format(MISSING_VARIABLE_IN_BODY, "values", body)));
        ClassOrInterfaceType arrayClass = parseClassOrInterfaceType(ArrayList.class.getName());
        ObjectCreationExpr objectCreationExpr = new ObjectCreationExpr();
        objectCreationExpr.setType(arrayClass);
        assignExpr.setValue(objectCreationExpr);
        for (Object value : values) {
            Expression valueExpression;
            if (arrayType == ARRAY_TYPE.STRING) {
                valueExpression = new StringLiteralExpr(value.toString());
            } else {
                valueExpression = new NameExpr(value.toString());
            }
            NodeList<Expression> arguments = NodeList.nodeList(valueExpression);
            MethodCallExpr methodCallExpr = new MethodCallExpr();
            methodCallExpr.setScope(assignExpr.getTarget().asNameExpr());
            methodCallExpr.setName("add");
            methodCallExpr.setArguments(arguments);
            ExpressionStmt expressionStmt = new ExpressionStmt();
            expressionStmt.setExpression(methodCallExpr);
            body.addStatement(expressionStmt);
        }
    }

    private  KiePMMLPredicateFactory();

}