Class SpigotConfigAdapter
java.lang.Object
cz.foresttech.forestredis.spigot.adapter.SpigotConfigAdapter
- All Implemented Interfaces:
IConfigurationAdapter
Implementation of
IConfigurationAdapter
for Spigot version-
Constructor Summary
ConstructorsConstructorDescriptionSpigotConfigAdapter
(org.bukkit.plugin.java.JavaPlugin plugin) Constructs the instance of adapter. -
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.
-
Constructor Details
-
SpigotConfigAdapter
public SpigotConfigAdapter(org.bukkit.plugin.java.JavaPlugin plugin) Constructs the instance of adapter.- Parameters:
plugin
-JavaPlugin
instance
-
-
Method Details
-
setup
Description copied from interface:IConfigurationAdapter
Setups the configuration file by provided name.- Specified by:
setup
in interfaceIConfigurationAdapter
- Parameters:
fileName
- Name of the file to setup
-
isSetup
public boolean isSetup()Description copied from interface:IConfigurationAdapter
Checks if the configuration is setup- Specified by:
isSetup
in interfaceIConfigurationAdapter
- Returns:
- If the configuration is setup
-
loadConfiguration
public void loadConfiguration()Description copied from interface:IConfigurationAdapter
Loads the configuration- Specified by:
loadConfiguration
in interfaceIConfigurationAdapter
-
getString
Description copied from interface:IConfigurationAdapter
Returns the String value from the configuration.- Specified by:
getString
in interfaceIConfigurationAdapter
- 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
Description copied from interface:IConfigurationAdapter
Returns the int value from the configuration.- Specified by:
getInt
in interfaceIConfigurationAdapter
- 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
Description copied from interface:IConfigurationAdapter
Returns the boolean value from the configuration.- Specified by:
getBoolean
in interfaceIConfigurationAdapter
- 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
Description copied from interface:IConfigurationAdapter
Returns the list of Strings from the configuration.- Specified by:
getStringList
in interfaceIConfigurationAdapter
- Parameters:
path
- Path in the configuration.- Returns:
- list of strings from the configuration. Returns empty list if path is not available.
-