Class CommentablePath<T>

java.lang.Object
me.hsgamer.hscore.config.path.CommentablePath<T>
Type Parameters:
T - the type of the value
All Implemented Interfaces:
ConfigPath<T>

public class CommentablePath<T> extends Object implements ConfigPath<T>
A commentable config path
  • Constructor Details

    • CommentablePath

      public CommentablePath(@NotNull @NotNull ConfigPath<T> originalPath, @NotNull @NotNull String... defaultComments)
      Create a config path
      Parameters:
      originalPath - the original config path
      defaultComments - the default comments
  • Method Details

    • getValue

      public T getValue()
      Description copied from interface: ConfigPath
      Get the value
      Specified by:
      getValue in interface ConfigPath<T>
      Returns:
      the value
    • setValue

      public void setValue(@Nullable T value)
      Description copied from interface: ConfigPath
      Set the value
      Specified by:
      setValue in interface ConfigPath<T>
      Parameters:
      value - the value
    • getValue

      public T getValue(@NotNull @NotNull Config config)
      Description copied from interface: ConfigPath
      Get the value from the config. This is used to get the value from multiple configs.
      Specified by:
      getValue in interface ConfigPath<T>
      Parameters:
      config - the config
      Returns:
      the value
    • setValue

      public void setValue(@Nullable T value, @NotNull @NotNull Config config)
      Description copied from interface: ConfigPath
      Set the value to the config. This is used to set the value to multiple configs.
      Specified by:
      setValue in interface ConfigPath<T>
      Parameters:
      value - the value
      config - the config
    • getPath

      @NotNull public @NotNull String getPath()
      Description copied from interface: ConfigPath
      Get the path to the value
      Specified by:
      getPath in interface ConfigPath<T>
      Returns:
      the path
    • getConfig

      @Nullable public @Nullable Config getConfig()
      Description copied from interface: ConfigPath
      Get the config
      Specified by:
      getConfig in interface ConfigPath<T>
      Returns:
      the config
    • setConfig

      public void setConfig(@NotNull @NotNull Config config)
      Description copied from interface: ConfigPath
      Set the config.
      Specified by:
      setConfig in interface ConfigPath<T>
      Parameters:
      config - the config
    • migrateConfig

      public void migrateConfig(@NotNull @NotNull Config config)
      Description copied from interface: ConfigPath
      Manually update the config (Mainly used when updating new settings)
      Specified by:
      migrateConfig in interface ConfigPath<T>
      Parameters:
      config - the config
    • getComment

      @Nullable public @Nullable String getComment()
      Get the block comment
      Returns:
      the comment
    • setComment

      public void setComment(@Nullable @Nullable String comment)
      Set the block comment
      Parameters:
      comment - the comment
    • getComment

      @Nullable public @Nullable String getComment(@NotNull @NotNull CommentType commentType)
      Get the comment
      Parameters:
      commentType - the comment type
      Returns:
      the comment
    • setComment

      public void setComment(@NotNull @NotNull CommentType commentType, @Nullable @Nullable String comment)
      Set the comment
      Parameters:
      commentType - the comment type
      comment - the comment