class KiePMMLPredicateFactory {

    static void setSimplePredicateConstructor(final String generatedClassName,
                                              final String predicateName,
                                              final ConstructorDeclaration constructorDeclaration,
                                              final OPERATOR operator,
                                              final Object value) {
        if (operator.equals(OPERATOR.IS_MISSING) || operator.equals(OPERATOR.IS_NOT_MISSING) ) {
            throw new IllegalArgumentException(operator + " not supported, yet");
        }
        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, "operator", operator.getClass().getCanonicalName() + "." + operator.name());
        Expression expression = value instanceof String ? new StringLiteralExpr((String) value) : new NameExpr(value.toString());
        CommonCodegenUtils.setAssignExpressionValue(body, "value", expression);
    }

    private  KiePMMLPredicateFactory();

}