1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 18:48:20 +08:00

feat(section): Add shaded section

This commit is contained in:
2025-02-21 17:31:05 +08:00
parent df19da170b
commit 9e008ff4cd
@@ -10,9 +10,21 @@ import java.util.Map;
public class ShadedSection implements ConfigureSection { public class ShadedSection implements ConfigureSection {
protected final @Nullable ShadedSection parent;
protected final @NotNull ConfigureSection section;
protected final @Nullable ConfigureSection template;
public ShadedSection(@NotNull ShadedSection parent,
@NotNull ConfigureSection section, @Nullable ConfigureSection template) {
this.parent = parent;
this.section = section;
this.template = template;
}
@Override @Override
public @Nullable ConfigureSection parent() { public @Nullable ShadedSection parent() {
return null; return this.parent;
} }
@Override @Override
@@ -23,16 +35,27 @@ public class ShadedSection implements ConfigureSection {
@Override @Override
public void set(@NotNull String path, @Nullable Object value) { public void set(@NotNull String path, @Nullable Object value) {
} if (value instanceof ConfigureSection) {
@Override }
public void remove(@NotNull String path) {
} }
@Override @Override
public @Nullable Object get(@NotNull String path) { public @Nullable Object get(@NotNull String path) {
if (section.contains(path)) {
return section.get(path);
}
return null; return null;
} }
@Override
public void remove(@NotNull String path) {
section.remove(path);
}
} }