All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codelibs.elasticsearch.df.util.MapUtils Maven / Gradle / Ivy

There is a newer version: 7.10.0
Show newest version
package org.codelibs.elasticsearch.df.util;

import java.util.Map;

public class MapUtils {
    private MapUtils() {
    }

    @SuppressWarnings("unchecked")
    public static void convertToFlatMap(final String prefix,
            final Map oldMap, final Map newMap) {
        for (final Map.Entry entry : oldMap.entrySet()) {
            final Object value = entry.getValue();
            if (value instanceof Map) {
                convertToFlatMap(prefix + entry.getKey() + ".",
                        (Map) value, newMap);
            } else {
                newMap.put(prefix + entry.getKey(), value);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy