Interface IConfigurationAdapter
- All Known Implementing Classes:
BungeeConfigAdapter
,SpigotConfigAdapter
public interface IConfigurationAdapter
ConfigurationAdapter interface which handles differences between BungeeCord and Spigot in configuration structure.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getBoolean
(String path, boolean def) Returns the boolean value from the configuration.int
Returns the int value from the configuration.Returns the String value from the configuration.getStringList
(String path) Returns the list of Strings from the configuration.boolean
isSetup()
Checks if the configuration is setupvoid
Loads the configurationvoid
Setups the configuration file by provided name.
-
Method Details
-
setup
Setups the configuration file by provided name.- Parameters:
fileName
- Name of the file to setup
-
isSetup
boolean isSetup()Checks if the configuration is setup- Returns:
- If the configuration is setup
-
loadConfiguration
void loadConfiguration()Loads the configuration -
getString
Returns the String value from the configuration.- Parameters:
path
- Path in the configuration.def
- Default value if the path is not set.- Returns:
- String value from the configuration. Returns "def" if path is not available.
-
getInt
Returns the int value from the configuration.- Parameters:
path
- Path in the configuration.def
- Default value if the path is not set.- Returns:
- int value from the configuration. Returns "def" if path is not available.
-
getBoolean
Returns the boolean value from the configuration.- Parameters:
path
- Path in the configuration.def
- Default value if the path is not set.- Returns:
- boolean value from the configuration. Returns "def" if path is not available.
-
getStringList
Returns the list of Strings from the configuration.- Parameters:
path
- Path in the configuration.- Returns:
- list of strings from the configuration. Returns empty list if path is not available.
-