Package wtf.choco.veinminer.util
Class ConfigWrapper
java.lang.Object
wtf.choco.veinminer.util.ConfigWrapper
A simple wrapper to more easily handle
YamlConfiguration instances.-
Constructor Summary
ConstructorsConstructorDescriptionConfigWrapper(@NotNull JavaPlugin plugin, @NotNull File directory, @NotNull String name) Construct a newConfigWrapper.ConfigWrapper(@NotNull JavaPlugin plugin, @NotNull String path) Construct a newConfigWrapper. -
Method Summary
Modifier and TypeMethodDescription@NotNull FileConfigurationGet thisConfigWrapperas a rawFileConfigurationinstance.voidreload()Reload values from file into memory.voidsave()Save thisConfigWrapper.voidSave thisConfigWrapperand throw anIOExceptionif one occurs according toFileConfiguration.save(File).
-
Constructor Details
-
ConfigWrapper
public ConfigWrapper(@NotNull @NotNull JavaPlugin plugin, @NotNull @NotNull File directory, @NotNull @NotNull String name) Construct a newConfigWrapper.- Parameters:
plugin- the plugin instancedirectory- the directory at which the config is locatedname- the name of the config file
-
ConfigWrapper
Construct a newConfigWrapper.- Parameters:
plugin- the plugin instancepath- the path at which the config is located
-
-
Method Details
-
asRawConfig
Get thisConfigWrapperas a rawFileConfigurationinstance.- Returns:
- the raw config
-
saveExceptionally
Save thisConfigWrapperand throw anIOExceptionif one occurs according toFileConfiguration.save(File).- Throws:
IOException- if an IOException is thrown byFileConfiguration.save(File)
-
save
public void save()Save thisConfigWrapper. -
reload
public void reload()Reload values from file into memory.
-