java.lang.Object
me.confuser.banmanager.common.configs.Config
Direct Known Subclasses:
ConsoleConfig, DefaultConfig, ExemptionsConfig, GeoIpConfig, MessagesConfig, ReasonsConfig, SchedulesConfig, WebhookConfig

public abstract class Config extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setFile

      public Config setFile(File input)
      Must be called before using config.load() or config.save();
      Parameters:
      input -
      Returns:
      (Config) instance
    • load

      public boolean load()
      Lazy load
      Returns:
      true if the config was loaded successfully, false otherwise
    • afterLoad

      public abstract void afterLoad()
    • onSave

      public abstract void onSave()
    • onLoad

      public boolean onLoad(File file) throws Exception
      Load configuration from file
      Parameters:
      file - the file to load
      Returns:
      true if the config was loaded successfully, false otherwise
      Throws:
      Exception - if the file does not exist
    • save

      public void save()