Package me.a8kj.config.file.impl
Class BasicVelocityConfig
- All Implemented Interfaces:
CreatableConfig<String>,CRUDOperations<String>,DeletableConfig<String>,ReadableConfig<String>,UpdatableConfig<String>
A specialized implementation of configuration for Velocity using Configurate 4.
This version supports both GenericMap and MapPaired memory types to ensure data is correctly persisted to disk using Yaml BLOCK style for better readability.
- Since:
- 0.2
- Author:
- a8kj7sea
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonPostCreate(ConfigFile<String> config) Logic executed after the configuration file is created.protected voidonPostDelete(ConfigFile<String> config) Logic executed after the configuration file is deleted.read()Provides a read operation to load Yaml data into memory.update()Provides an update operation to save memory state back to Yaml file.Methods inherited from class me.a8kj.config.file.BaseConfig
create, delete, getReader, getWriter, onPreCreate, onPreDelete
-
Constructor Details
-
BasicVelocityConfig
public BasicVelocityConfig()
-
-
Method Details
-
onPostCreate
Logic executed after the configuration file is created. FiresConfigCreateEventand logs the process.- Overrides:
onPostCreatein classBaseConfig<String>- Parameters:
config- The configuration file instance.
-
onPostDelete
Logic executed after the configuration file is deleted. FiresConfigDeleteEventand logs the warning.- Overrides:
onPostDeletein classBaseConfig<String>- Parameters:
config- The configuration file instance.
-
read
Provides a read operation to load Yaml data into memory. Uses BLOCK style and 2-space indentation by default.- Specified by:
readin interfaceReadableConfig<String>- Specified by:
readin classBaseConfig<String>- Returns:
- A
ConfigOperationfor reading data.
-
update
Provides an update operation to save memory state back to Yaml file. Supports multi-layer path resolution by splitting keys with dot notation.- Specified by:
updatein interfaceUpdatableConfig<String>- Specified by:
updatein classBaseConfig<String>- Returns:
- A
ConfigOperationfor updating data.
-