Class Config.MigrationChain

java.lang.Object
com.github.darksoulq.abyssallib.common.config.Config.MigrationChain
Enclosing class:
Config

public class Config.MigrationChain extends Object
A fluent builder for defining data migrations specific to this configuration file.
  • Method Details

    • fix

      public Config.MigrationChain fix(int fromVersion, DataFixer fixer)
      Registers a data fixer to transition the config from a specific version.
      Parameters:
      fromVersion - The version this fixer applies to.
      fixer - The data mutation logic.
      Returns:
      This builder instance for chaining.
    • apply

      public Config apply()
      Executes the migration chain and finalizes the configuration state.

      Reads the current "config_version" from the file, applies all necessary registered fixers sequentially, and saves the updated structure back to disk.

      Returns:
      The parent Config instance.