浏览代码

Improve javadoc

Lortseam 4 年之前
父节点
当前提交
7042063b58

+ 3 - 3
src/main/java/me/lortseam/completeconfig/ConfigBuilder.java

@@ -28,9 +28,9 @@ public final class ConfigBuilder {
     }
 
     /**
-     * Adds one or multiple top-level categories to the config.
+     * Adds one or more top-level categories to the config.
      *
-     * @param categories the top-level categories
+     * @param categories one or more top-level categories
      * @return this config builder
      */
     public ConfigBuilder add(ConfigCategory... categories) {
@@ -41,7 +41,7 @@ public final class ConfigBuilder {
     /**
      * Sets a custom client GUI builder for the config.
      *
-     * @param guiBuilder The GUI builder
+     * @param guiBuilder a GUI builder
      * @return this config builder
      */
     public ConfigBuilder setGuiBuilder(GuiBuilder guiBuilder) {

+ 5 - 3
src/main/java/me/lortseam/completeconfig/api/ConfigCategory.java

@@ -3,14 +3,16 @@ package me.lortseam.completeconfig.api;
 import com.google.common.base.CaseFormat;
 
 /**
- * A container of config entries which has an identifier additionally.
+ * A container of config entries which has a unique identifier additionally.
  */
 public interface ConfigCategory extends ConfigEntryContainer {
 
     /**
-     * Used to modify the ID of this category. Defaults to the class name. Override this method to set a custom ID.
+     * Used to identify this category. Defaults to the class name.
      *
-     * @return the ID of this config category
+     * <p>Override this method to set a custom ID.
+     *
+     * @return the ID of this category
      */
     default String getConfigCategoryID() {
         return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, getClass().getSimpleName());

+ 7 - 7
src/main/java/me/lortseam/completeconfig/api/ConfigEntry.java

@@ -13,7 +13,7 @@ import java.lang.annotation.Target;
  * Applied to declare that a field is an entry inside the mod's config. Only required if
  * the {@link ConfigEntryContainer} is not a POJO class.
  *
- * <p>This annotation also contains some options to modify the entry.
+ * <p>This annotation also contains various options to modify the entry.
  */
 @Target(ElementType.FIELD)
 @Retention(RetentionPolicy.RUNTIME)
@@ -27,7 +27,7 @@ public @interface ConfigEntry {
     String value() default "";
 
     /**
-     * Specifies a custom translation key for this entry. If empty, the default key will be used.
+     * Specifies a custom translation key for this entry. If empty, the default key for this entry will be used.
      *
      * @return a custom translation key
      */
@@ -47,14 +47,14 @@ public @interface ConfigEntry {
      * <p>By default the entry's field will not get modified when the config is saved, but all listeners will be called
      * with the updated value. Set this to true to always update the field when saving.
      *
-     * @return true if the field should get updated, else false
+     * @return true if the field should always get updated, else false
      */
     boolean forceUpdate() default false;
 
     /**
-     * Specifies whether the game needs to be restarted after modifying this entry.
+     * Specifies whether the game needs to be restarted after modifying the entry.
      *
-     * @return whether the game needs to be restarted after modifying this field's entry
+     * @return whether the game needs to be restarted after modifying the entry
      */
     boolean requiresRestart() default false;
 
@@ -188,8 +188,8 @@ public @interface ConfigEntry {
     }
 
     /**
-     * Can be applied to a field inside a POJO {@link ConfigEntryContainer} class to declare that the field should not
-     * be considered as config entry.
+     * Can be applied to a field inside a POJO {@link ConfigEntryContainer} class to declare that that field should not
+     * be considered to be config entry.
      */
     @Target(ElementType.FIELD)
     @Retention(RetentionPolicy.RUNTIME)

+ 9 - 3
src/main/java/me/lortseam/completeconfig/api/ConfigEntryContainer.java

@@ -15,7 +15,7 @@ import java.util.List;
 public interface ConfigEntryContainer {
 
     /**
-     * Used to register other containers. They will be located on the same level.
+     * Used to register other containers. They will then be located at the same level as this container.
      *
      * @return an array of other containers
      * @see Transitive
@@ -24,13 +24,19 @@ public interface ConfigEntryContainer {
         return new ConfigEntryContainer[0];
     }
 
+    /**
+     * Specifies whether this class is a POJO. If true, every field inside this class will be considered to be a config
+     * entry.
+     *
+     * @return whether this class is a POJO
+     */
     default boolean isConfigPOJO() {
         return false;
     }
 
     /**
-     * Applied to declare that a field of type {@link ConfigEntryContainer} is transitive. The container will be
-     * registered on the same level.
+     * Applied to declare that a field of type {@link ConfigEntryContainer} is transitive. The container will then be
+     * registered at the same level as this container.
      *
      * @see #getTransitiveConfigEntryContainers()
      */

+ 1 - 1
src/main/java/me/lortseam/completeconfig/api/ConfigEntryListener.java

@@ -16,7 +16,7 @@ import java.lang.annotation.Target;
 public @interface ConfigEntryListener {
 
     /**
-     * Specifies the name of the field.
+     * Specifies the name of the entry's field.
      *
      * @return the entry's field name
      */

+ 3 - 3
src/main/java/me/lortseam/completeconfig/api/ConfigOwner.java

@@ -5,7 +5,7 @@ import me.lortseam.completeconfig.ConfigBuilder;
 /**
  * This entrypoint is called to create a config in a specific environment or in both environments.
  *
- * <p>In {@code fabric.mod.json}, the entrypoint is defined with {@code completeconfig} key.</p>
+ * <p>In {@code fabric.mod.json}, the entrypoint is defined with the {@code completeconfig} key.</p>
  */
 public interface ConfigOwner {
 
@@ -35,9 +35,9 @@ public interface ConfigOwner {
     }
 
     /**
-     * Used to set a specific branch for the configuration(s) created by this entrypoint.
+     * Used to set a specific branch for the config(s) created using this entrypoint.
      *
-     * <p>A config branch defines the location of the config's save file. The root of this branch is always the mod ID.
+     * <p>A config branch defines the location of the config's save file.
      *
      * @return the config branch
      */