
org.codelibs.elasticsearch.df.util.MapUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-dataformat Show documentation
Show all versions of elasticsearch-dataformat Show documentation
This plugin provides several response formats.
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