Class StickyConfigPath<T>

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

public class StickyConfigPath<T> extends CachedValue<T> implements ConfigPath<T>
An ConfigPath which stores the value for later uses
  • Constructor Details

    • StickyConfigPath

      public StickyConfigPath(ConfigPath<T> originalPath)
      Create a config path
      Parameters:
      originalPath - the original config path
  • Method Details

    • generate

      public T generate()
      Specified by:
      generate in class CachedValue<T>
    • reload

      public void reload()
      Description copied from interface: ConfigPath
      Reload the path
      Specified by:
      reload in interface ConfigPath<T>
    • 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