1
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:
2025-02-21 17:15:16 +08:00
parent 3473ef2247
commit df19da170b
2 changed files with 25 additions and 1 deletions
@@ -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;
}
}