Class Configuration
java.lang.Object
space.b00tload.utils.configuration.Configuration
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 Summary
Modifier and TypeMethodDescriptionget(ConfigValues v) Gets a value from the configstatic ConfigurationUsed to get the singleton instancestatic voidinit(String[] args, String currentSoftwareVersion, String applicationBaseDir, ConfigValues[] configValues) Initializes the singelton instance.
-
Method Details
-
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 launchcurrentSoftwareVersion- The current version number of the software using this utilapplicationBaseDir- The directory in which the config folder and file are to be createdconfigValues- 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
Gets a value from the config- Parameters:
v- the key of the value to be returned- Returns:
- the requested value
-