public String escapeValue(TypeReference typeReference, String valueString) {
        if (valueString == null) {
            return null;
        }
        if (typeReference.isSimpleTypeReference()) {
            SimpleTypeReference simpleTypeReference = (SimpleTypeReference) typeReference;
            switch (simpleTypeReference.getBaseType()) {
                case UINT:
                case INT:
                    // If it's a one character string and is numeric, output it as char.
                    if (!NumberUtils.isParsable(valueString) && (valueString.length() == 1)) {
                        return "'" + valueString + "'";
                    }
                    break;
                case STRING:
                case VSTRING:
                    return "\"" + valueString + "\"";
            }
        } else if (typeReference.isEnumTypeReference()) {
            if(options.containsKey("externalTypes")) {
                Object externalTypes = options.get("externalTypes");
                if (!(externalTypes instanceof Map)) {
                    throw new IllegalArgumentException("The option 'externalTypes' is not a Map");
                }
                Map<String, Object> externalTypesMap = (Map<String, Object>) externalTypes;

                // If this is an external type
                if(externalTypesMap.containsKey(typeReference.asEnumTypeReference().orElseThrow().getName())) {
                    String namespace = (String) externalTypesMap.get(typeReference.asEnumTypeReference().orElseThrow().getName());
                    String namespacePrefix = namespace.contains(".") ? namespace.substring(namespace.lastIndexOf(".") + 1) : namespace;
                    return namespacePrefix + "." + typeReference.asEnumTypeReference().orElseThrow().getName() + "." + valueString;
                }
            }

            return "model." + typeReference.asEnumTypeReference().orElseThrow().getName() + "." + valueString;
        }
        return valueString;
    }
@param field               this generally only is needed in order to access field attributes such as encoding etc.
@param resultType          the type the resulting expression should have
@param term                the term representing the expression
@param serializerArguments any serializer arguments, which could be referenced in expressions (Needed for getting the type)
@return Java code which does the things defined in 'term'
code-generation/language-cs/src/main/java/org/apache/plc4x/language/cs/CsLanguageTemplateHelper.java