class PMMLCompilerService {

    static void addPMMLRuleMappers(final KiePMMLModel kiePMMLModel, final List<String> generatedRuleMappers,
                                   final String sourcePath) {
        if (!(kiePMMLModel instanceof HasSourcesMap)) {
            String errorMessage = String.format("Expecting HasSourcesMap instance, retrieved %s inside %s",
                                                kiePMMLModel.getClass().getName(),
                                                sourcePath);
            throw new KiePMMLException(errorMessage);
        }
        if (generatedRuleMappers.isEmpty()) {
            return;
        }
        String predictionRuleMapper = kiePMMLModel.getKModulePackageName() + "." + KIE_PMML_RULE_MAPPERS_CLASS_NAME;
        String ruleMapperSource =
                PMMLRuleMappersFactory.getPMMLRuleMappersSource(kiePMMLModel.getKModulePackageName(),
                                                                generatedRuleMappers);
        ((HasSourcesMap) kiePMMLModel).addSourceMap(predictionRuleMapper, ruleMapperSource);
    }

    private  PMMLCompilerService();

}