Browse Source

Code improvements

Lortseam 4 years ago
parent
commit
f8afa8daa0

+ 2 - 2
lib/src/main/java/me/lortseam/completeconfig/data/BaseCollection.java

@@ -28,7 +28,7 @@ abstract class BaseCollection implements ParentDataPart, Translatable {
         return Collections.unmodifiableCollection(collections);
     }
 
-    void resolveContainer(ConfigContainer container) {
+    final void resolveContainer(ConfigContainer container) {
         entries.resolve(container);
         for (Class<? extends ConfigContainer> clazz : container.getConfigClasses()) {
             resolve(Arrays.stream(clazz.getDeclaredFields()).filter(field -> {
@@ -73,7 +73,7 @@ abstract class BaseCollection implements ParentDataPart, Translatable {
         resolve(container.getTransitives());
     }
 
-    void resolve(ConfigContainer... containers) {
+    final void resolve(ConfigContainer... containers) {
         for (ConfigContainer container : containers) {
             if (container instanceof ConfigGroup) {
                 collections.resolve((ConfigGroup) container);

+ 1 - 1
lib/src/main/java/me/lortseam/completeconfig/data/Collection.java

@@ -17,7 +17,7 @@ import java.util.Arrays;
 
 @Log4j2(topic = "CompleteConfig")
 @RequiredArgsConstructor(access = AccessLevel.PACKAGE)
-public class Collection extends BaseCollection implements Identifiable, TooltipSupplier {
+public final class Collection extends BaseCollection implements Identifiable, TooltipSupplier {
 
     private final BaseCollection parent;
     private final ConfigGroup group;

+ 2 - 2
lib/src/main/java/me/lortseam/completeconfig/data/Config.java

@@ -74,7 +74,7 @@ public class Config extends BaseCollection {
     /**
      * Loads the config.
      */
-    public void load() {
+    public final void load() {
         if (!loaded && this instanceof ConfigContainer) {
             resolve((ConfigContainer) this);
         }
@@ -89,7 +89,7 @@ public class Config extends BaseCollection {
     /**
      * Saves the config.
      */
-    public void save() {
+    public final void save() {
         if (!loaded) {
             throw new IllegalStateException("Cannot save config before it was loaded");
         }