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 Summary
Modifier and TypeMethodDescriptionbooleanChecks if a path exists in this section.Gets a value from this section.Gets a value with default.booleangetBoolean(String path) Gets a boolean value.booleangetBoolean(String path, boolean def) Gets a boolean value with default.doubleGets a double value.doubleGets a double value with default.intGets an integer value.intGets an integer value with default.getKeys(boolean deep) Gets all keys in this section.getSection(String path) Gets a nested section.Gets a string value.Gets a string value with default.Gets all values in this section.
-
Method Details
-
get
-
get
-
getString
-
getString
-
getInt
Gets an integer value.- Parameters:
path- the path relative to this section- Returns:
- the integer value, or 0 if not found
-
getInt
Gets an integer value with default.- Parameters:
path- the path relative to this sectiondef- the default value- Returns:
- the integer value, or default if not found
-
getDouble
Gets a double value.- Parameters:
path- the path relative to this section- Returns:
- the double value, or 0.0 if not found
-
getDouble
Gets a double value with default.- Parameters:
path- the path relative to this sectiondef- the default value- Returns:
- the double value, or default if not found
-
getBoolean
Gets a boolean value.- Parameters:
path- the path relative to this section- Returns:
- the boolean value, or false if not found
-
getBoolean
Gets a boolean value with default.- Parameters:
path- the path relative to this sectiondef- the default value- Returns:
- the boolean value, or default if not found
-
getSection
Gets a nested section.- Parameters:
path- the path to the section- Returns:
- the config section, or null if not found
-
getKeys
-
getValues
-
contains
Checks if a path exists in this section.- Parameters:
path- the path to check- Returns:
- true if exists
-