private static <K, V> Map<K, V> stringToMap(
            final Prop prop,
            final String serialisedForm,
            final Class<K> keyType,
            final Class<V> valueType) {

        if (serialisedForm == null || serialisedForm.isEmpty()) {
            return Collections.emptyMap();
        } else {

            final String entryDelimiter = String.valueOf(serialisedForm.charAt(0));
            validateDelimiter(serialisedForm, 0, "first", MAP_EXAMPLE);

            final String keyValueDelimiter = String.valueOf(serialisedForm.charAt(1));
            validateDelimiter(serialisedForm, 1, "second", MAP_EXAMPLE);

            // now remove the delimiters from our value
            final String delimitedValue = serialisedForm.substring(2);

            return StreamSupport.stream(
                            Splitter
                                    .on(entryDelimiter)
                                    .split(delimitedValue)
                                    .spliterator(), false)
                    .map(keyValueStr -> {
                        final List<String> parts = Splitter.on(keyValueDelimiter)
                                .splitToList(keyValueStr);

                        if (parts.size() < 1 || parts.size() > 2) {
                            throw new RuntimeException(LogUtil.message(
                                    "Too many parts [{}] in value [{}], whole value [{}]",
                                    parts.size(), keyValueStr, serialisedForm));
                        }

                        final String keyStr = parts.get(0);
                        final String valueStr = parts.size() == 1
                                ? null
                                : parts.get(1);

                        final K key = keyType.cast(convertToObject(prop, keyStr, keyType));
                        final V value = valueStr != null
                                ? valueType.cast(convertToObject(prop, valueStr, valueType))
                                : null;

                        return Map.entry(key, value);
                    })
                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
        }
    }
@param dbConfigProperty The config property object obtained from the database
@return The updated typed value from the object model
stroom-config/stroom-config-global-impl/src/main/java/stroom/config/global/impl/ConfigMapper.java