Added createSection(String path, Map<String, object> map)

This commit is contained in:
Feildmaster
2011-11-01 22:04:48 -05:00
committed by Nathan Adams
parent fa9a2e158b
commit 95b487d274
4 changed files with 39 additions and 1 deletions

View File

@@ -266,6 +266,20 @@ public class MemorySection implements ConfigurationSection {
return section.createSection(key);
}
}
public ConfigurationSection createSection(String path, Map<String, Object> map) {
ConfigurationSection section = createSection(path);
for(Map.Entry<String, Object> entry : map.entrySet()) {
if(entry.getValue() instanceof Map) {
section.createSection(entry.getKey(), (Map<String, Object>)entry.getValue());
} else {
section.set(entry.getKey(), entry.getValue());
}
}
return section;
}
// Primitives
public String getString(String path) {