// Path: src/main/java/com/github/kislayverma/rulette/rest/exception/RuleNotFoundException.java
// @ResponseStatus(value= HttpStatus.NOT_FOUND, reason="No rule found for the given input")
// public class RuleNotFoundException extends RuntimeException {
// 
//     public RuleNotFoundException(String msg) {
//         super(msg);
//     }
// 
//     public RuleNotFoundException(Throwable e) {
//         super(e);
//     }
// 
//     public RuleNotFoundException(String msg, Throwable e) {
//         super(msg, e);
//     }
// }
// 
// Path: src/main/java/com/github/kislayverma/rulette/rest/exception/RuleSystemNotFoundException.java
// @ResponseStatus(value= HttpStatus.NOT_FOUND, reason="No such rule system found")
// public class RuleSystemNotFoundException extends RuntimeException {
// 
//     public RuleSystemNotFoundException(String msg) {
//         super(msg);
//     }
// 
//     public RuleSystemNotFoundException(Throwable e) {
//         super(e);
//     }
// 
//     public RuleSystemNotFoundException(String msg, Throwable e) {
//         super(msg, e);
//     }
// }
// 
// Path: src/main/java/com/github/kislayverma/rulette/rest/api/rulesystem/RuleSystemMetadataDto.java
// public class RuleSystemMetadataDto implements Serializable {
//     private String ruleSystemName;
//     private String tableName;
//     private List<RuleInputMetaData> inputColumnList;
//     private String uniqueIdColumnName;
//     private String uniqueOutputColumnName;
//     private String providerName;
// 
//     @Override
//     public String toString() {
//         return "RuleSystemMetadataDto{" +
//             "ruleSystemName='" + ruleSystemName + '\'' +
//             ", tableName='" + tableName + '\'' +
//             ", inputColumnList=" + inputColumnList +
//             ", uniqueIdColumnName='" + uniqueIdColumnName + '\'' +
//             ", uniqueOutputColumnName='" + uniqueOutputColumnName + '\'' +
//             ", providerName='" + providerName + '\'' +
//             '}';
//     }
// 
//     public String getProviderName() {
//         return providerName;
//     }
// 
//     public void setProviderName(String providerName) {
//         this.providerName = providerName;
//     }
// 
//     public String getRuleSystemName() {
//         return ruleSystemName;
//     }
// 
//     public void setRuleSystemName(String ruleSystemName) {
//         this.ruleSystemName = ruleSystemName;
//     }
// 
//     public String getTableName() {
//         return tableName;
//     }
// 
//     public void setTableName(String tableName) {
//         this.tableName = tableName;
//     }
// 
//     public List<RuleInputMetaData> getInputColumnList() {
//         return inputColumnList;
//     }
// 
//     public void setInputColumnList(List<RuleInputMetaData> inputColumnList) {
//         this.inputColumnList = inputColumnList;
//     }
// 
//     public String getUniqueIdColumnName() {
//         return uniqueIdColumnName;
//     }
// 
//     public void setUniqueIdColumnName(String uniqueIdColumnName) {
//         this.uniqueIdColumnName = uniqueIdColumnName;
//     }
// 
//     public String getUniqueOutputColumnName() {
//         return uniqueOutputColumnName;
//     }
// 
//     public void setUniqueOutputColumnName(String uniqueOutputColumnName) {
//         this.uniqueOutputColumnName = uniqueOutputColumnName;
//     }
// }


import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.kislayverma.rulette.RuleSystem;
import com.github.kislayverma.rulette.core.metadata.RuleInputMetaData;
import com.github.kislayverma.rulette.core.metadata.RuleSystemMetaData;
import com.github.kislayverma.rulette.core.rule.Rule;
import com.github.kislayverma.rulette.core.ruleinput.type.RuleInputType;
import com.github.kislayverma.rulette.rest.exception.RuleNotFoundException;
import com.github.kislayverma.rulette.rest.exception.RuleSystemNotFoundException;
import com.github.kislayverma.rulette.rest.api.rulesystem.RuleSystemMetadataDto;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
        String rangeLowerBoundFieldName = intputMap.get("rangeLowerBoundFieldName");
        String rangeUpperBoundFieldName = intputMap.get("rangeUpperBoundFieldName");

        return new RuleInputMetaData(
            name, priority, inputType, dataType, rangeLowerBoundFieldName, rangeUpperBoundFieldName);
    }

    public static Map<String, String> convertJsonToMap(JsonNode jsonData) {
        Map<String, String> map = new HashMap<>();
        Map<String, Object> objMap =
            OBJECT_MAPPER.convertValue(jsonData, new TypeReference<Map<String, Object>>(){});

        objMap.entrySet()
            .stream()
            .forEach(entry -> {
                if (entry.getValue() != null) {
                    map.put(entry.getKey(), (String) entry.getValue().toString());
                }
            });

        return map;
    }

    public static RuleSystemMetadataDto transformToDto(RuleSystemMetaData rsmd, String providerName) {
        RuleSystemMetadataDto dto = new RuleSystemMetadataDto();
        dto.setRuleSystemName(rsmd.getRuleSystemName());
        dto.setProviderName(providerName);
        dto.setInputColumnList(rsmd.getInputColumnList());
        dto.setTableName(rsmd.getTableName());
        dto.setUniqueIdColumnName(rsmd.getUniqueIdColumnName());
// Path: src/main/java/com/github/kislayverma/rulette/rest/exception/RuleNotFoundException.java
// @ResponseStatus(value= HttpStatus.NOT_FOUND, reason="No rule found for the given input")
// public class RuleNotFoundException extends RuntimeException {
// 
//     public RuleNotFoundException(String msg) {
//         super(msg);
//     }
// 
//     public RuleNotFoundException(Throwable e) {
//         super(e);
//     }
// 
//     public RuleNotFoundException(String msg, Throwable e) {
//         super(msg, e);
//     }
// }
// 
// Path: src/main/java/com/github/kislayverma/rulette/rest/exception/RuleSystemNotFoundException.java
// @ResponseStatus(value= HttpStatus.NOT_FOUND, reason="No such rule system found")
// public class RuleSystemNotFoundException extends RuntimeException {
// 
//     public RuleSystemNotFoundException(String msg) {
//         super(msg);
//     }
// 
//     public RuleSystemNotFoundException(Throwable e) {
//         super(e);
//     }
// 
//     public RuleSystemNotFoundException(String msg, Throwable e) {
//         super(msg, e);
//     }
// }
// 
// Path: src/main/java/com/github/kislayverma/rulette/rest/api/rulesystem/RuleSystemMetadataDto.java
// public class RuleSystemMetadataDto implements Serializable {
//     private String ruleSystemName;
//     private String tableName;
//     private List<RuleInputMetaData> inputColumnList;
//     private String uniqueIdColumnName;
//     private String uniqueOutputColumnName;
//     private String providerName;
// 
//     @Override
//     public String toString() {
//         return "RuleSystemMetadataDto{" +
//             "ruleSystemName='" + ruleSystemName + '\'' +
//             ", tableName='" + tableName + '\'' +
//             ", inputColumnList=" + inputColumnList +
//             ", uniqueIdColumnName='" + uniqueIdColumnName + '\'' +
//             ", uniqueOutputColumnName='" + uniqueOutputColumnName + '\'' +
//             ", providerName='" + providerName + '\'' +
//             '}';
//     }
// 
//     public String getProviderName() {
//         return providerName;
//     }
// 
//     public void setProviderName(String providerName) {
//         this.providerName = providerName;
//     }
// 
//     public String getRuleSystemName() {
//         return ruleSystemName;
//     }
// 
//     public void setRuleSystemName(String ruleSystemName) {
//         this.ruleSystemName = ruleSystemName;
//     }
// 
//     public String getTableName() {
//         return tableName;
//     }
// 
//     public void setTableName(String tableName) {
//         this.tableName = tableName;
//     }
// 
//     public List<RuleInputMetaData> getInputColumnList() {
//         return inputColumnList;
//     }
// 
//     public void setInputColumnList(List<RuleInputMetaData> inputColumnList) {
//         this.inputColumnList = inputColumnList;
//     }
// 
//     public String getUniqueIdColumnName() {
//         return uniqueIdColumnName;
//     }
// 
//     public void setUniqueIdColumnName(String uniqueIdColumnName) {
//         this.uniqueIdColumnName = uniqueIdColumnName;
//     }
// 
//     public String getUniqueOutputColumnName() {
//         return uniqueOutputColumnName;
//     }
// 
//     public void setUniqueOutputColumnName(String uniqueOutputColumnName) {
//         this.uniqueOutputColumnName = uniqueOutputColumnName;
//     }
// }


// Path: src/main/java/com/github/kislayverma/rulette/rest/utils/TransformerUtil.java
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.kislayverma.rulette.RuleSystem;
import com.github.kislayverma.rulette.core.metadata.RuleInputMetaData;
import com.github.kislayverma.rulette.core.metadata.RuleSystemMetaData;
import com.github.kislayverma.rulette.core.rule.Rule;
import com.github.kislayverma.rulette.core.ruleinput.type.RuleInputType;
import com.github.kislayverma.rulette.rest.exception.RuleNotFoundException;
import com.github.kislayverma.rulette.rest.exception.RuleSystemNotFoundException;
import com.github.kislayverma.rulette.rest.api.rulesystem.RuleSystemMetadataDto;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

        String rangeLowerBoundFieldName = intputMap.get("rangeLowerBoundFieldName");
        String rangeUpperBoundFieldName = intputMap.get("rangeUpperBoundFieldName");

        return new RuleInputMetaData(
            name, priority, inputType, dataType, rangeLowerBoundFieldName, rangeUpperBoundFieldName);
    }

    public static Map<String, String> convertJsonToMap(JsonNode jsonData) {
        Map<String, String> map = new HashMap<>();
        Map<String, Object> objMap =
            OBJECT_MAPPER.convertValue(jsonData, new TypeReference<Map<String, Object>>(){});

        objMap.entrySet()
            .stream()
            .forEach(entry -> {
                if (entry.getValue() != null) {
                    map.put(entry.getKey(), (String) entry.getValue().toString());
                }
            });

        return map;
    }

    public static RuleSystemMetadataDto transformToDto(RuleSystemMetaData rsmd, String providerName) {
        RuleSystemMetadataDto dto = new RuleSystemMetadataDto();
        dto.setRuleSystemName(rsmd.getRuleSystemName());
        dto.setProviderName(providerName);
        dto.setInputColumnList(rsmd.getInputColumnList());
        dto.setTableName(rsmd.getTableName());
        dto.setUniqueIdColumnName(rsmd.getUniqueIdColumnName());
        dto.setUniqueOutputColumnName(rsmd.getUniqueOutputColumnName());