Interface Configurable

All Known Implementing Classes:
UltiToolsPlugin

public interface Configurable
Configurable data operation interface.
  • Method Details

    • getAllConfigs

      default List<AbstractConfigEntity> getAllConfigs()
      Returns:
      All configs
    • getConfig

      <T extends AbstractConfigEntity> T getConfig(Class<T> configType)
      Get config by config type.
      Type Parameters:
      T - Config type
      Parameters:
      configType - Config type
      Returns:
      Config
    • getConfig

      <T extends AbstractConfigEntity> T getConfig(String path, Class<T> configType)
      Get config by config path and config type.
      Type Parameters:
      T - Config type
      Parameters:
      path - Config path
      configType - Config type
      Returns:
      the entity registered for path, or null if none is registered (a registered entity of another type throws ClassCastException)
    • saveConfig

      <T extends AbstractConfigEntity> void saveConfig(String path, Class<T> configType) throws IOException
      Saves the configuration entity registered for path in this module. See UltiToolsPlugin.saveConfig(String, Class) for what is written. Throws IllegalStateException naming the module and path if no entity is registered for the path. If the registered entity is not an instance of configType, throws ClassCastException naming the module, path, expected type and actual type.
      Type Parameters:
      T - Config type
      Parameters:
      path - Config path
      configType - Config type
      Throws:
      IOException - IOException