Class SimpleLanguageConfig

java.lang.Object
de.themoep.utils.lang.LanguageConfig<Properties>
de.themoep.utils.lang.simple.SimpleLanguageConfig

public class SimpleLanguageConfig extends LanguageConfig<Properties>
  • Constructor Details

    • SimpleLanguageConfig

      public SimpleLanguageConfig(Languaged program, String resourceFolder, File resourceFile, String locale)
    • SimpleLanguageConfig

      public SimpleLanguageConfig(Languaged program, String resourceFolder, File resourceFile, String locale, boolean saveFile)
  • Method Details

    • loadConfig

      public void loadConfig()
      Description copied from class: LanguageConfig
      Load the config from the file system
      Specified by:
      loadConfig in class LanguageConfig<Properties>
    • saveConfigResource

      public boolean saveConfigResource()
      Description copied from class: LanguageConfig
      Save the default config resource from the jar file to the file system
      Specified by:
      saveConfigResource in class LanguageConfig<Properties>
      Returns:
      Whether or not the file was saved. If it already existed this will return false
    • contains

      public boolean contains(String key)
      Description copied from class: LanguageConfig
      Check if the config contains a certain key
      Specified by:
      contains in class LanguageConfig<Properties>
      Parameters:
      key - The key of the string
      Returns:
      true if this config (and not the defaults) has this key, false if not
    • contains

      public boolean contains(String key, boolean checkDefault)
      Description copied from class: LanguageConfig
      Check if the config contains a certain key
      Specified by:
      contains in class LanguageConfig<Properties>
      Parameters:
      key - The key of the string
      checkDefault - Whether or not to check the default config
      Returns:
      true if this config (and the default) has this key, false if not
    • get

      public String get(String key)
      Description copied from class: LanguageConfig
      Get a string from the config by its key
      Specified by:
      get in class LanguageConfig<Properties>
      Parameters:
      key - The key of the string
      Returns:
      The message or an error message if it doesn't exist; never null! (use LanguageConfig.contains(String) to check existance)
    • getRawConfig

      public Properties getRawConfig()
      Description copied from class: LanguageConfig
      Get the raw config object
      Specified by:
      getRawConfig in class LanguageConfig<Properties>
      Returns:
      The raw config object