Klasse LegacyImportMappingStore
java.lang.Object
de.delinkedde.areashopreborn.importer.legacy.LegacyImportMappingStore
Stores explicit administrator-approved values for ambiguous legacy AreaShop inheritance.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumFields whose effective legacy values may be supplied explicitly.static final recordImmutable mapping row.static final recordImmutable in-memory view used for one complete import run. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungLegacyImportMappingStore(Path file) Creates a mapping store.LegacyImportMappingStore(Path file, long maximumFileBytes, int maximumEntries) Creates a bounded mapping store. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglist()Lists every configured mapping in stable source order.list(int limit) Lists a bounded prefix of configured mappings.booleanremove(String sourceKey, LegacyImportMappingStore.Field field) Removes one mapped field and deletes an empty source row.resolve(String sourceKey, LegacyImportMappingStore.Field field) Resolves one explicit value.voidset(String sourceKey, LegacyImportMappingStore.Field field, String value) Sets one explicit effective value and atomically rewrites the mapping file.snapshot()Loads, validates, and deeply freezes the entire bounded mapping file once.
-
Konstruktordetails
-
LegacyImportMappingStore
Creates a mapping store.- Parameter:
file- mapping YAML file inside the plugin data directory
-
LegacyImportMappingStore
Creates a bounded mapping store.- Parameter:
file- mapping YAML file inside the plugin data directorymaximumFileBytes- maximum mapping YAML sizemaximumEntries- maximum distinct source rows
-
-
Methodendetails
-
resolve
public Optional<String> resolve(String sourceKey, LegacyImportMappingStore.Field field) throws IOException, LegacyImportException Resolves one explicit value.- Parameter:
sourceKey- legacy source pathfield- requested field- Gibt zurück:
- mapped value when configured
- Löst aus:
IOException- when the mapping file cannot be readLegacyImportException- when stored data is malformed
-
snapshot
Loads, validates, and deeply freezes the entire bounded mapping file once.- Gibt zurück:
- immutable mapping snapshot
- Löst aus:
IOException- when the mapping file cannot be readLegacyImportException- when stored data is malformed
-
list
Lists every configured mapping in stable source order.- Gibt zurück:
- immutable mappings
- Löst aus:
IOException- when the mapping file cannot be readLegacyImportException- when stored data is malformed
-
list
public List<LegacyImportMappingStore.Mapping> list(int limit) throws IOException, LegacyImportException Lists a bounded prefix of configured mappings.- Parameter:
limit- maximum rows returned- Gibt zurück:
- immutable mappings in stable order
- Löst aus:
IOException- when the mapping file cannot be readLegacyImportException- when stored data is malformed
-
set
public void set(String sourceKey, LegacyImportMappingStore.Field field, String value) throws IOException, LegacyImportException Sets one explicit effective value and atomically rewrites the mapping file.- Parameter:
sourceKey- legacy source pathfield- mapped fieldvalue- explicit literal value- Löst aus:
IOException- when persistence failsLegacyImportException- when input or stored data is malformed
-
remove
public boolean remove(String sourceKey, LegacyImportMappingStore.Field field) throws IOException, LegacyImportException Removes one mapped field and deletes an empty source row.- Parameter:
sourceKey- legacy source pathfield- mapped field- Gibt zurück:
- whether a value existed
- Löst aus:
IOException- when persistence failsLegacyImportException- when input or stored data is malformed
-