public static ValueMap toValueMap()

in src/main/java/org/apache/sling/fsprovider/internal/mapper/valuemap/ValueMapUtil.java [39:52]


    public static ValueMap toValueMap(Map<String, Object> content) {
        Map<String, Object> props = new HashMap<>();

        for (Map.Entry<String, Object> entry : content.entrySet()) {
            if (entry.getValue() instanceof Collection) {
                // convert lists to arrays
                props.put(entry.getKey(), ((Collection) entry.getValue()).toArray());
            } else {
                props.put(entry.getKey(), entry.getValue());
            }
        }

        return new ValueMapDecorator(props);
    }