Class Configuration

java.lang.Object
space.b00tload.utils.configuration.Configuration

public class Configuration extends Object
Loads the configuration from all supported sources (cli-args, .env, toml-file, default).
Since:
1.0.0
Version:
1.0.0
Author:
Alix von Schirp
  • Method Details

    • getInstance

      public static Configuration getInstance()
      Used to get the singleton instance
      Returns:
      the singleton instance.
    • init

      public static void init(String[] args, String currentSoftwareVersion, String applicationBaseDir, ConfigValues[] configValues) throws ConfigIncompleteException
      Initializes the singelton instance.
      Parameters:
      args - The cli-args provided at software launch
      currentSoftwareVersion - The current version number of the software using this util
      applicationBaseDir - The directory in which the config folder and file are to be created
      configValues - The enum.values() array of the ConfigValues enum.
      Throws:
      ConfigIncompleteException - if not all values without a default value were set using other configuration methods.
    • get

      public String get(ConfigValues v)
      Gets a value from the config
      Parameters:
      v - the key of the value to be returned
      Returns:
      the requested value