Class AutoReadYamlSource

All Implemented Interfaces:
CreatableConfig<String>, CRUDOperations<String>, DeletableConfig<String>, ReadableConfig<String>, UpdatableConfig<String>

public class AutoReadYamlSource extends YamlSource
Provides an automated YAML configuration source that triggers a read operation immediately after creation.

Extends YamlSource to seamlessly load configuration data upon file initialization without requiring manual invocation.

Any exceptions during the auto-read process are logged using Log.error(String, Object...).

Since:
0.3
Author:
a8kj7sea
  • Constructor Details

    • AutoReadYamlSource

      public AutoReadYamlSource()
  • Method Details

    • onPostCreate

      protected void onPostCreate(ConfigFile<String> config)
      Invoked immediately after the configuration file has been created.

      This method automatically reads the configuration from the YAML source, ensuring that the ConfigFile is populated and ready for use. Any exceptions encountered during reading are caught and logged.

      Overrides:
      onPostCreate in class BaseConfig<String>
      Parameters:
      config - the ConfigFile context being initialized