Class TomlConfiguration
java.lang.Object
space.b00tload.utils.configuration.TomlConfiguration
- All Implemented Interfaces:
AutoCloseable
Interfaces with the toml config file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckVersion(String currentVersion) Checks whether the config version is the same as software version.voidclose()Saves and closes the config file.booleanChecks if the config contains a value at some path.Gets a value from the config.voidSets a value to the config.
-
Method Details
-
close
public void close()Saves and closes the config file.- Specified by:
closein interfaceAutoCloseable
-
checkVersion
Checks whether the config version is the same as software version. Sends a warning to stderr if version was updated.- Parameters:
currentVersion- The current software version.
-
contains
Checks if the config contains a value at some path.- Parameters:
key- the path to check, each part separated by a dot. Example "a. b. c"- Returns:
trueif the path is associated with a value,falseif it's not.
-
getString
Gets a value from the config.- Parameters:
key- the value's path, each part separated by a dot. Example "a. b. c"- Returns:
- the value at the given path, or
nullif there is no such value.
-
setString
Sets a value to the config.- Parameters:
key- the value's path, each part separated by a dot. Example "a. b. c"value- the value to set
-