Interface Config
- All Superinterfaces:
ConfigNode
- All Known Implementing Classes:
BukkitConfig,BungeeConfig,ConfigurateConfig,GsonConfig
The root configuration interface, extending
ConfigNode.
Provides file-level operations beyond the node-based access.-
Method Summary
Modifier and TypeMethodDescriptiondefault ConfigGet the root Config that owns this nodegetName()Get the name of the configuration (typically the file name)Get the original underlying object (e.g., JsonObject, ConfigurationNode)default ConfigNodeGet the parent node (the origin).default String[]getPath()Get the path relative to the origin node.default booleanhasChild()Check if this node has childrenbooleanisNormalizable(Object object) Check if the object can be normalizedNormalize a library-specific object to plain Java typesvoidreload()Reload the configuration from diskvoidsave()Save the configuration to diskvoidsetup()Set up the configuration (create file, load initial data)Methods inherited from interface io.github.projectunified.craftconfig.common.ConfigNode
exists, get, get, get, get, getChildren, getComment, getComment, getNormalized, node, normalizeObject, remove, set, setComment, setComment, setIfAbsent
-
Method Details
-
getPath
Description copied from interface:ConfigNodeGet the path relative to the origin node. When obtained from Config.node(), returns the full path from root. When obtained from ConfigNode.node() or getChildren(), returns the relative path.- Specified by:
getPathin interfaceConfigNode- Returns:
- the path segments
-
getParent
Description copied from interface:ConfigNodeGet the parent node (the origin). When obtained from Config.node(), returns the Config (root node). When obtained from ConfigNode.node() or getChildren(), returns that ConfigNode.- Specified by:
getParentin interfaceConfigNode- Returns:
- the parent node
-
getConfig
Description copied from interface:ConfigNodeGet the root Config that owns this node- Specified by:
getConfigin interfaceConfigNode- Returns:
- the owning Config
-
hasChild
default boolean hasChild()Description copied from interface:ConfigNodeCheck if this node has children- Specified by:
hasChildin interfaceConfigNode- Returns:
- true if this node has child nodes
-
getName
String getName()Get the name of the configuration (typically the file name)- Returns:
- the name
-
setup
void setup()Set up the configuration (create file, load initial data) -
save
void save()Save the configuration to disk -
reload
void reload()Reload the configuration from disk -
getOriginal
Object getOriginal()Get the original underlying object (e.g., JsonObject, ConfigurationNode)- Returns:
- the original instance
-
normalize
Normalize a library-specific object to plain Java types- Parameters:
object- the object to normalize- Returns:
- the normalized object
-
isNormalizable
Check if the object can be normalized- Parameters:
object- the object- Returns:
- true if it is normalizable
-