diff --git a/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSection.java b/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSection.java
index a12ded5..fee5588 100644
--- a/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSection.java
+++ b/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSection.java
@@ -48,7 +48,6 @@ public interface ConfigureSection {
return (parent().isRoot() ? "" : parent().fullPath() + pathSeparator()) + path();
}
-
/**
* Get the path separator for the section.
*
@@ -143,6 +142,17 @@ public interface ConfigureSection {
return getValues(false);
}
+ /**
+ * Get this section as a map.
+ *
+ * In this map, child {@link ConfigureSection}s will also be represented as {@link Map}s.
+ *
+ * @return Map of data values contained within this Section.
+ */
+ @NotNull
+ @UnmodifiableView
+ Map asMap();
+
/**
* Create a stream of all values in this section.
*
@@ -153,7 +163,7 @@ public interface ConfigureSection {
}
/**
- * Iterates over all keys in this section.
+ * Iterates over all key-values in this section (include child sections)
*
* @param action The action to apply to each key.
*/
diff --git a/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSource.java b/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSource.java
index 202249d..ee95f15 100644
--- a/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSource.java
+++ b/core/src/main/java/cc/carm/lib/configuration/source/section/ConfigureSource.java
@@ -107,6 +107,11 @@ public abstract class ConfigureSource<
return section().getKeys(deep);
}
+ @Override
+ public @NotNull @UnmodifiableView Map asMap() {
+ return section().asMap();
+ }
+
@Override
public @NotNull ConfigureSection createSection(@NotNull String path, @NotNull Map, ?> data) {
return section().createSection(path, data);
diff --git a/demo/pom.xml b/demo/pom.xml
index 293fa60..5646638 100644
--- a/demo/pom.xml
+++ b/demo/pom.xml
@@ -5,7 +5,7 @@
easyconfiguration-parent
cc.carm.lib
- 4.0.8
+ 4.0.9
4.0.0
diff --git a/features/commentable/pom.xml b/features/commentable/pom.xml
index 61912b7..d4298ed 100644
--- a/features/commentable/pom.xml
+++ b/features/commentable/pom.xml
@@ -6,7 +6,7 @@
cc.carm.lib
easyconfiguration-parent
- 4.0.8
+ 4.0.9
../../pom.xml
diff --git a/features/file/pom.xml b/features/file/pom.xml
index 5ac7568..3e020bf 100644
--- a/features/file/pom.xml
+++ b/features/file/pom.xml
@@ -6,7 +6,7 @@
cc.carm.lib
easyconfiguration-parent
- 4.0.8
+ 4.0.9
../../pom.xml
diff --git a/features/section/pom.xml b/features/section/pom.xml
index c3969b1..73d49c7 100644
--- a/features/section/pom.xml
+++ b/features/section/pom.xml
@@ -6,7 +6,7 @@
cc.carm.lib
easyconfiguration-parent
- 4.0.8
+ 4.0.9
../../pom.xml
diff --git a/features/section/src/main/java/cc/carm/lib/configuration/source/section/AbstractMapSection.java b/features/section/src/main/java/cc/carm/lib/configuration/source/section/AbstractMapSection.java
index 0bd40f1..478aea4 100644
--- a/features/section/src/main/java/cc/carm/lib/configuration/source/section/AbstractMapSection.java
+++ b/features/section/src/main/java/cc/carm/lib/configuration/source/section/AbstractMapSection.java
@@ -75,17 +75,18 @@ public abstract class AbstractMapSection> implem
return deep ? getKeys(true).size() : this.data.size();
}
+ @Override
@UnmodifiableView
- public @NotNull Map rawMap() {
+ public @NotNull Map asMap() {
Map output = new LinkedHashMap<>();
for (Map.Entry entry : this.data.entrySet()) {
if (entry.getValue() instanceof AbstractMapSection>) {
- output.put(entry.getKey(), ((AbstractMapSection>) entry.getValue()).rawMap());
+ output.put(entry.getKey(), ((AbstractMapSection>) entry.getValue()).asMap());
} else if (entry.getValue() instanceof List>) {
List