Class ConfigurationUtil

java.lang.Object
net.lewmc.kryptonite.utils.ConfigurationUtil

public class ConfigurationUtil extends Object
ConfigurationUtil is a helper class for managing YML configuration files.
  • Constructor Details

    • ConfigurationUtil

      public ConfigurationUtil(Kryptonite plugin, org.bukkit.command.CommandSender user)
      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

      public void load(String path)
      Loads a configuration file into memory.
      Parameters:
      path - String - The path to the file.
    • set

      public void set(String key, Object value)
      Sets a key to the requested value.
      Parameters:
      key - String - The key.
      value - Object - The value.
    • get

      public Object get(String key)
      Gets a requested value (could be anything!)
      Parameters:
      key - String - The key.
      Returns:
      Object - The value
    • getInt

      public int getInt(String key)
      Gets a requested value as an integer.
      Parameters:
      key - String - The key.
      Returns:
      int - The value
    • getString

      public String getString(String key)
      Gets a requested value as a string.
      Parameters:
      key - String - The key.
      Returns:
      String - The value
    • getBoolean

      public boolean getBoolean(String key)
      Gets a requested value as a boolean.
      Parameters:
      key - String - The key.
      Returns:
      boolean - The value
    • save

      public void save()
      Saves the configuration file.