Package rocks.rdil.simpleconfig
Class ConfigHandler
- java.lang.Object
-
- rocks.rdil.simpleconfig.ConfigHandler
-
public final class ConfigHandler extends java.lang.Object
The handler for JSON files - managesConfig
classes.
-
-
Constructor Summary
Constructors Constructor Description ConfigHandler(java.io.File file)
Creates a new instance of the configuration handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonObject
getCfg()
Get the JSON object for all the registeredConfig
s.void
register(Config config)
Registers aConfig
class to the current JSON file.void
save()
Saves the configuration to the file assigned to this handler.
-
-
-
Method Detail
-
getCfg
public final com.google.gson.JsonObject getCfg()
Get the JSON object for all the registeredConfig
s.- Returns:
- The JsonObject instance.
-
register
public final void register(Config config)
Registers aConfig
class to the current JSON file.- Parameters:
config
- The config class.
-
save
public final void save()
Saves the configuration to the file assigned to this handler.
-
-