- All Known Subinterfaces:
YamlConfiguration
public interface ConfigurationSection
Represents a section of a configuration file, providing methods to retrieve and manipulate configuration values.
-
Method Summary
boolean
Checks if the configuration contains a value at the specified path.
Object
Retrieves a value from the configuration.
Boolean
Retrieves a boolean value from the configuration.
double
Retrieves a double value from the configuration.
int
Retrieves an integer value from the configuration.
Set<String>
Retrieves all keys in the current configuration section.
Retrieves a nested section within the configuration.
String
Retrieves a string value from the configuration.
List<String>
Retrieves a list of strings from the configuration.
boolean
Checks if the value at the specified path is null.
boolean
Checks if the specified path represents a valid configuration section.
void
set(String path,
Object obj)
Sets a value in the configuration.
-
Method Details
-
getSection
Retrieves a nested section within the configuration.
- Parameters:
-
path - the path to the section
- Returns:
- the
ConfigurationSection at the specified path, or null if it does not exist
-
isSection
boolean isSection(String path)
Checks if the specified path represents a valid configuration section.
- Parameters:
-
path - the path to check
- Returns:
- true if the path is a section, false otherwise
-
set
void set(String path,
Object obj)
Sets a value in the configuration.
- Parameters:
-
path - the path to set the value at
-
obj - the value to set
-
get
Object get(String path)
Retrieves a value from the configuration.
- Parameters:
-
path - the path of the value
- Returns:
- the value at the specified path, or null if not found
-
isNull
boolean isNull(String path)
Checks if the value at the specified path is null.
- Parameters:
-
path - the path to check
- Returns:
- true if the value is null, false otherwise
-
getString
String getString(String path)
Retrieves a string value from the configuration.
- Parameters:
-
path - the path of the value
- Returns:
- the string value, or null if not found
-
getBoolean
Boolean getBoolean(String path)
Retrieves a boolean value from the configuration.
- Parameters:
-
path - the path of the value
- Returns:
- the boolean value, or false if not found
-
getInt
int getInt(String path)
Retrieves an integer value from the configuration.
- Parameters:
-
path - the path of the value
- Returns:
- the integer value, or 0 if not found
-
getDouble
double getDouble(String path)
Retrieves a double value from the configuration.
- Parameters:
-
path - the path of the value
- Returns:
- the double value, or 0.0 if not found
-
getStringList
List<String> getStringList(String path)
Retrieves a list of strings from the configuration.
- Parameters:
-
path - the path of the list
- Returns:
- the list of strings, or an empty list if not found
-
contains
boolean contains(String path)
Checks if the configuration contains a value at the specified path.
- Parameters:
-
path - the path to check
- Returns:
- true if the path exists, false otherwise
-
getKeys
Set<String> getKeys(boolean deep)
Retrieves all keys in the current configuration section.
- Returns:
- a collection of keys within this section