Package net.lewmc.kryptonite.utils
Class ConfigurationUtil
java.lang.Object
net.lewmc.kryptonite.utils.ConfigurationUtil
ConfigurationUtil is a helper class for managing YML configuration files.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationUtil
(Kryptonite plugin, org.bukkit.command.CommandSender user) Constructor for the ConfigurationUtil class. -
Method Summary
Modifier and TypeMethodDescriptionGets a requested value (could be anything!)boolean
getBoolean
(String key) Gets a requested value as a boolean.int
Gets a requested value as an integer.Gets a requested value as a string.void
Loads a configuration file into memory.void
save()
Saves the configuration file.void
Sets a key to the requested value.
-
Constructor Details
-
ConfigurationUtil
Constructor for the ConfigurationUtil class.- Parameters:
plugin
- Kryptonite - Reference to the main plugin class.user
- CommandSender - The user who sent the command.
-
-
Method Details
-
load
Loads a configuration file into memory.- Parameters:
path
- String - The path to the file.
-
set
Sets a key to the requested value.- Parameters:
key
- String - The key.value
- Object - The value.
-
get
Gets a requested value (could be anything!)- Parameters:
key
- String - The key.- Returns:
- Object - The value
-
getInt
Gets a requested value as an integer.- Parameters:
key
- String - The key.- Returns:
- int - The value
-
getString
Gets a requested value as a string.- Parameters:
key
- String - The key.- Returns:
- String - The value
-
getBoolean
Gets a requested value as a boolean.- Parameters:
key
- String - The key.- Returns:
- boolean - The value
-
save
public void save()Saves the configuration file.
-