public class PlainMigrationService extends Object implements MigrationService
MIGRATION_REQUIRED, NO_MIGRATION_NEEDED| Constructor and Description |
|---|
PlainMigrationService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndMigrate(PropertyReader reader,
ConfigurationData configurationData)
Performs the migration, returning whether a migration has been performed or not.
|
protected static <T> boolean |
moveProperty(Property<T> oldProperty,
Property<T> newProperty,
PropertyReader reader,
ConfigurationData configurationData)
Utility method: moves the value of an old property to a new property.
|
protected boolean |
performMigrations(PropertyReader reader,
ConfigurationData configurationData)
Override this method for custom migrations.
|
public boolean checkAndMigrate(PropertyReader reader, ConfigurationData configurationData)
MigrationServicecheckAndMigrate in interface MigrationServicereader - reader to access the values in the configuration fileconfigurationData - configuration data, which knows all properties and manages their associated valuesprotected boolean performMigrations(PropertyReader reader, ConfigurationData configurationData)
Note that the settings manager automatically saves the resource
if the migration service returns MigrationService.MIGRATION_REQUIRED from checkAndMigrate(ch.jalu.configme.resource.PropertyReader, ch.jalu.configme.configurationdata.ConfigurationData).
reader - the reader with which the configuration file can be readconfigurationData - the configuration dataMigrationService)protected static <T> boolean moveProperty(Property<T> oldProperty, Property<T> newProperty, PropertyReader reader, ConfigurationData configurationData)
T - the type of the propertyoldProperty - the old property (create a temporary Property object with the path)newProperty - the new property to move the value toreader - the property reader to read the configuration file fromconfigurationData - configuration data to update a property's valueCopyright © 2016–2018 The AuthMe Team. All rights reserved.