Interface ConfigSection

All Known Implementing Classes:
BaseConfig.MapConfigSection

public interface ConfigSection
Represents a section within a configuration.

ConfigSection allows access to nested configuration values.

Example Usage:

ConfigSection server = config.getSection("server");
String name = server.getString("name");
int port = server.getInt("port", 25565);
Since:
1.0.4
Version:
1.0.4
Author:
HytaleLoader
  • Method Details

    • get

      Object get(String path)
      Gets a value from this section.
      Parameters:
      path - the path relative to this section
      Returns:
      the value, or null if not found
    • get

      Object get(String path, Object def)
      Gets a value with default.
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the value, or default if not found
    • getString

      String getString(String path)
      Gets a string value.
      Parameters:
      path - the path relative to this section
      Returns:
      the string value, or null if not found
    • getString

      String getString(String path, String def)
      Gets a string value with default.
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the string value, or default if not found
    • getInt

      int getInt(String path)
      Gets an integer value.
      Parameters:
      path - the path relative to this section
      Returns:
      the integer value, or 0 if not found
    • getInt

      int getInt(String path, int def)
      Gets an integer value with default.
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the integer value, or default if not found
    • getDouble

      double getDouble(String path)
      Gets a double value.
      Parameters:
      path - the path relative to this section
      Returns:
      the double value, or 0.0 if not found
    • getDouble

      double getDouble(String path, double def)
      Gets a double value with default.
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the double value, or default if not found
    • getBoolean

      boolean getBoolean(String path)
      Gets a boolean value.
      Parameters:
      path - the path relative to this section
      Returns:
      the boolean value, or false if not found
    • getBoolean

      boolean getBoolean(String path, boolean def)
      Gets a boolean value with default.
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the boolean value, or default if not found
    • getSection

      ConfigSection getSection(String path)
      Gets a nested section.
      Parameters:
      path - the path to the section
      Returns:
      the config section, or null if not found
    • getKeys

      Set<String> getKeys(boolean deep)
      Gets all keys in this section.
      Parameters:
      deep - whether to include nested keys
      Returns:
      set of keys
    • getValues

      Map<String,Object> getValues()
      Gets all values in this section.
      Returns:
      map of all values
    • contains

      boolean contains(String path)
      Checks if a path exists in this section.
      Parameters:
      path - the path to check
      Returns:
      true if exists