Selaa lähdekoodia

Use Lombok's @NonNull

Lortseam 4 vuotta sitten
vanhempi
sitoutus
86cf0811ad
1 muutettua tiedostoa jossa 7 lisäystä ja 6 poistoa
  1. 7 6
      src/main/java/me/lortseam/completeconfig/data/Config.java

+ 7 - 6
src/main/java/me/lortseam/completeconfig/data/Config.java

@@ -1,5 +1,6 @@
 package me.lortseam.completeconfig.data;
 
+import lombok.NonNull;
 import lombok.extern.log4j.Log4j2;
 import me.lortseam.completeconfig.ConfigHandler;
 import me.lortseam.completeconfig.api.ConfigGroup;
@@ -22,8 +23,8 @@ public class Config extends CollectionMap {
      *
      * @param modID the ID of the mod creating the config
      */
-    public static Builder builder(String modID) {
-        if (!FabricLoader.getInstance().isModLoaded(Objects.requireNonNull(modID))) {
+    public static Builder builder(@NonNull String modID) {
+        if (!FabricLoader.getInstance().isModLoaded(modID)) {
             throw new IllegalArgumentException("Mod " + modID + " is not loaded");
         }
         return new Builder(modID);
@@ -76,8 +77,8 @@ public class Config extends CollectionMap {
          * @param branch the branch
          * @return this builder
          */
-        public Builder setBranch(String[] branch) {
-            this.branch = Objects.requireNonNull(branch);
+        public Builder setBranch(@NonNull String[] branch) {
+            this.branch = branch;
             return this;
         }
 
@@ -100,8 +101,8 @@ public class Config extends CollectionMap {
          * @return this builder
          */
         @Environment(EnvType.CLIENT)
-        public Builder setGuiBuilder(GuiBuilder guiBuilder) {
-            this.guiBuilder = Objects.requireNonNull(guiBuilder);
+        public Builder setGuiBuilder(@NonNull GuiBuilder guiBuilder) {
+            this.guiBuilder = guiBuilder;
             return this;
         }