Package net.mezzdev.config.api.migration
Interface IConfigMigrationResult
@NonExtendable
public interface IConfigMigrationResult
Reports the final outcome of a registered legacy migration.
Inspect this from IConfigMigrator.onMigrationComplete(IConfigMigrationResult) or
ISortingConfigMigrator.onMigrationComplete(IConfigMigrationResult) when the mod wants to log a failure, tell the
user what was imported, or locate the preserved backup. This also reports outcomes that the migration callback cannot
observe itself, such as a skipped migration or a failure after it returns.
- Since:
- 0.3.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the preserved backup that can be shown to the user or used for recovery.Get the new MezzConfig file that migration targeted.Get the reason an attempted migration failed.Get the old config file that was selected for import.Get the migration outcome.
-
Method Details
-
getStatus
ConfigMigrationStatus getStatus()Get the migration outcome.- Returns:
- migration status
- Since:
- 0.3.0
-
getDestinationPath
Get the new MezzConfig file that migration targeted. This is empty when the migration target had no active local destination.- Returns:
- migration destination, if one was available
- Since:
- 0.3.0
-
getLegacyPath
Get the old config file that was selected for import.- Returns:
- selected normalized absolute legacy path, if one was found
- Since:
- 0.3.0
-
getBackupPath
Get the preserved backup that can be shown to the user or used for recovery. A failed migration may still have a backup when failure happened after backup creation.- Returns:
- normalized absolute backup path, if a backup was created
- Since:
- 0.3.0
-
getFailure
Get the reason an attempted migration failed.- Returns:
- migration failure, or empty for non-failure outcomes
- Since:
- 0.3.0
-