Package net.mezzdev.config.api.migration
Interface ISortingConfigMigrationContext<T>
- Type Parameters:
T- sortable value type
@NonExtendable
public interface ISortingConfigMigrationContext<T>
Supplies a converted legacy order to a sorting config.
MezzConfig passes this to ISortingConfigMigrator.migrate(java.nio.file.Path, net.mezzdev.config.api.migration.ISortingConfigMigrationContext<T>). Call setSortedValues(Collection, List) with
every value known to the old order and the values that were visible, in their saved order.
- Since:
- 0.3.0
-
Method Summary
Modifier and TypeMethodDescriptionsetSortedValues(Collection<T> allValues, List<T> sortedValues) Import the converted saved order.
-
Method Details
-
setSortedValues
Import the converted saved order.The collections have the same meaning and validation rules as
ISortingConfig.setSortedValues(Collection, List)and are copied before this method returns. If this is called more than once, the last order is used.- Parameters:
allValues- every migrated value known to this sort ordersortedValues- visible migrated values in their saved order- Returns:
- this migration context
- Throws:
IllegalArgumentException- if either collection violates the sorting config's contractIllegalStateException- if the migration callback has returned- Since:
- 0.3.0
-