private Object convertCompareValue(String compareValue, PlcTag plcTag) throws ScraperConfigurationException {
            Class<?> javaDataType = validateDataType(plcTag);
            if(javaDataType.equals(Boolean.class)){
                switch (compareValue){
                    case "1":
                    case "true":
                        return true;
                    case "0":
                    case "false":
                        return false;
                    default:
                        String exceptionMessage = String.format("No valid compare Value at DataType Boolean for trigger: %s",compareValue);
                        throw new ScraperConfigurationException(exceptionMessage);
                }
            }
            if(javaDataType.equals(Double.class)
                || javaDataType.equals(Integer.class)
                || javaDataType.equals(Long.class)){
                try {
                    //everything fits to Double for conversion ... so for first step use only double
                    //ToDo if different handling dependent on specific datatype is needed then differ
                    if(PREVIOUS_DEF.equals(compareValue)){
                        this.previousMode=true;
                        return null;
                    }
                    return Double.parseDouble(compareValue);
                }
                catch (Exception e){
                    logger.debug(e.getMessage(), e);
                    String exceptionMessage = String.format("No valid compare Value at DataType Numeric for trigger: %s",compareValue);
                    throw new ScraperConfigurationException(exceptionMessage);
                }
            }
            String exceptionMessage = "Invalid Datatype detected ... should not happen and be catcht earlier - please report";
            throw new ScraperConfigurationException(exceptionMessage);
        }
parses the ref-value to a given value, as well as checking if ref-value matches to the given data-type
@param compareValue compare-value extracted by regex
@return converted object to needed data-type
@throws ScraperException when something does not match or parsing fails
plc4j/tools/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/triggerhandler/TriggerConfiguration.java