Class ConfigurationSectionBuilder
java.lang.Object
io.github.monsieurdoceo.filizer.storage.domain.ConfigurationSectionBuilder
Represents a configuration section that can be created
and populated inside a
FileConfiguration.
A FileSection stores key-value pairs internally
until createSection(FileConfiguration) is called.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateSection(org.bukkit.configuration.file.FileConfiguration config) Creates this section in the provided configuration.getData()Returns the data stored in this section.getName()Returns the name of this section.replaceData(Map<String, Object> data) Replaces the current section data.Adds or replaces a value in this section.
-
Constructor Details
-
ConfigurationSectionBuilder
Creates a new empty file section.- Parameters:
name- the name of the configuration section
-
-
Method Details
-
set
Adds or replaces a value in this section.- Parameters:
name- the key to storevalue- the value associated with the key- Returns:
- this section instance for chaining
-
replaceData
Replaces the current section data.- Parameters:
data- the new section data- Returns:
- this section instance for chaining
-
createSection
public void createSection(org.bukkit.configuration.file.FileConfiguration config) Creates this section in the provided configuration.- Parameters:
config- the configuration in which to create the section- Throws:
NullPointerException- if the configuration isnull
-
getName
Returns the name of this section.- Returns:
- the section name
-
getData
Returns the data stored in this section.- Returns:
- the section's key-value mappings
-