-
- All Superinterfaces:
DataStorage
- All Known Subinterfaces:
TcConfig
- All Known Implementing Classes:
FileConfig,FileConfigSection,MemoryConfigSection
public interface TcConfigSection extends DataStorage
Represents configuration section.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull TcConfigSectioncreateChild(@NotNull String path)Creates and returns the child section with specified path.@NotNull TcConfigSectioncreateChild(@NotNull String path, Map<String,?> values)Creates the child section by specified path with given values and returns it.@Nullable TcConfigSectiongetChild(@NotNull String path)Gets the child section with specified path.@NotNull StringgetFullPath()Gets the path of this section.@NotNull StringgetName()Gets the name of this section.@Nullable TcConfigSectiongetParent()Gets the section that contains this section.@NotNull TcConfiggetRoot()Gets the root config that contains this section.booleanhasChild(@NotNull String path)Checks if this section contains the given path and the given path is configuration section.-
Methods inherited from interface xyz.tozymc.configuration.DataStorage
compute, computeIfAbsent, computeIfPresent, contains, contains, find, find, get, get, getBoolean, getDouble, getDoubleList, getInt, getIntegerList, getKeys, getKeys, getList, getList, getLong, getMapList, getOrDefault, getOrDefault, getString, getStringList, getValues, isBoolean, isDouble, isInt, isList, isLong, isString, merge, remove, replace, set, setIfAbsent
-
-
-
-
Method Detail
-
hasChild
boolean hasChild(@NotNull @NotNull String path)
Checks if this section contains the given path and the given path is configuration section.- Parameters:
path- Path to child.- Returns:
- True if this section contains this path and this path is configuration section.
-
createChild
@NotNull @NotNull TcConfigSection createChild(@NotNull @NotNull String path) throws TcConfigException
Creates and returns the child section with specified path.- Parameters:
path- The path where the child section will be created.- Returns:
- The created child section.
- Throws:
TcConfigException- Thrown when path is existed.
-
createChild
@NotNull @NotNull TcConfigSection createChild(@NotNull @NotNull String path, Map<String,?> values) throws TcConfigException
Creates the child section by specified path with given values and returns it.- Parameters:
path- The path where the child section will be created.values- The values to set.- Returns:
- The created child section.
- Throws:
TcConfigException- Thrown when path is existed.
-
getChild
@Nullable @Nullable TcConfigSection getChild(@NotNull @NotNull String path)
Gets the child section with specified path.Returns
nullwhen child section not found.- Parameters:
path- Path to child.- Returns:
- The specified child section.
-
getParent
@Nullable @Nullable TcConfigSection getParent()
Gets the section that contains this section.Returns
nullwhen this section is root.- Returns:
- The section that contains this section.
-
getName
@NotNull @NotNull String getName()
Gets the name of this section.- Returns:
- This section name.
-
getFullPath
@NotNull @NotNull String getFullPath()
Gets the path of this section.The path can be used in the root config to get this section.
- Returns:
- This section path.
-
-