mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
feat(section): Add ConfigureSection#asMap function
This commit is contained in:
@@ -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.
|
||||
* <p>
|
||||
* 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<String, Object> 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.
|
||||
*/
|
||||
|
||||
@@ -107,6 +107,11 @@ public abstract class ConfigureSource<
|
||||
return section().getKeys(deep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull @UnmodifiableView Map<String, Object> asMap() {
|
||||
return section().asMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ConfigureSection createSection(@NotNull String path, @NotNull Map<?, ?> data) {
|
||||
return section().createSection(path, data);
|
||||
|
||||
Reference in New Issue
Block a user