Class ConfigurateConfig
java.lang.Object
io.github.projectunified.craftconfig.configurate.ConfigurateConfig
- All Implemented Interfaces:
Config,ConfigNode
The
Config implementation for Configurate-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfigurateConfig(File file, org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<?, ?> builder) -
Method Summary
Modifier and TypeMethodDescriptionget()Get the value at this nodeGet the child nodes of this node.getComment(CommentType type) Get the comment for this nodegetName()Get the name of the configuration (typically the file name)Get the original underlying object (e.g., JsonObject, ConfigurationNode)booleanisNormalizable(Object object) Check if the object can be normalizedNavigate to a child node.Normalize a library-specific object to plain Java typesvoidreload()Reload the configuration from diskvoidremove()Remove this node from the configurationvoidsave()Save the configuration to diskvoidSet the value at this nodevoidsetComment(CommentType type, List<String> value) Set the comment for this nodevoidsetup()Set up the configuration (create file, load initial data)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.craftconfig.common.Config
getConfig, getParent, getPath, hasChildMethods inherited from interface io.github.projectunified.craftconfig.common.ConfigNode
exists, get, get, get, getComment, getNormalized, normalizeObject, setComment, setIfAbsent
-
Constructor Details
-
ConfigurateConfig
public ConfigurateConfig(File file, org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<?, ?> builder)
-
-
Method Details
-
get
Description copied from interface:ConfigNodeGet the value at this node- Specified by:
getin interfaceConfigNode- Returns:
- the value, or null if not present
-
set
Description copied from interface:ConfigNodeSet the value at this node- Specified by:
setin interfaceConfigNode- Parameters:
value- the value to set
-
node
Description copied from interface:ConfigNodeNavigate to a child node. Should only be called ifConfigNode.hasChild()returns true.- Specified by:
nodein interfaceConfigNode- Parameters:
path- the path segments (relative to this node)- Returns:
- the child node
-
remove
public void remove()Description copied from interface:ConfigNodeRemove this node from the configuration- Specified by:
removein interfaceConfigNode
-
getChildren
Description copied from interface:ConfigNodeGet the child nodes of this node. Should only be called ifConfigNode.hasChild()returns true.- Specified by:
getChildrenin interfaceConfigNode- Returns:
- map of child key to child node
-
getComment
Description copied from interface:ConfigNodeGet the comment for this node- Specified by:
getCommentin interfaceConfigNode- Parameters:
type- the comment type- Returns:
- the comment lines, or empty list if none
-
setComment
Description copied from interface:ConfigNodeSet the comment for this node- Specified by:
setCommentin interfaceConfigNode- Parameters:
type- the comment typevalue- the comment lines, or null to remove
-
getName
Description copied from interface:ConfigGet the name of the configuration (typically the file name) -
setup
public void setup()Description copied from interface:ConfigSet up the configuration (create file, load initial data) -
save
public void save()Description copied from interface:ConfigSave the configuration to disk -
reload
public void reload()Description copied from interface:ConfigReload the configuration from disk -
getOriginal
Description copied from interface:ConfigGet the original underlying object (e.g., JsonObject, ConfigurationNode)- Specified by:
getOriginalin interfaceConfig- Returns:
- the original instance
-
normalize
Description copied from interface:ConfigNormalize a library-specific object to plain Java types -
isNormalizable
Description copied from interface:ConfigCheck if the object can be normalized- Specified by:
isNormalizablein interfaceConfig- Parameters:
object- the object- Returns:
- true if it is normalizable
-