mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
feat(section): Add #contains and #containsValue methods
This commit is contained in:
+11
@@ -45,6 +45,16 @@ public abstract class MapSection<R extends MapSection<R>> implements ConfigureSe
|
||||
return createChild(new LinkedHashMap<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(@NotNull String path) {
|
||||
R section = getSectionFor(path);
|
||||
if (section == this) {
|
||||
return this.data().containsKey(path);
|
||||
} else {
|
||||
return section.contains(childPath(path));
|
||||
}
|
||||
}
|
||||
|
||||
public @NotNull Map<String, Object> data() {
|
||||
return this.data;
|
||||
}
|
||||
@@ -136,4 +146,5 @@ public abstract class MapSection<R extends MapSection<R>> implements ConfigureSe
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user