Class FileOrderComparator
java.lang.Object
de.hybris.platform.acceleratorservices.dataimport.batch.FileOrderComparator
- All Implemented Interfaces:
Comparator<File>,org.springframework.beans.factory.InitializingBean
public class FileOrderComparator
extends Object
implements Comparator<File>, org.springframework.beans.factory.InitializingBean
Comparator that compares files based on their file names. On this behalf a priorities are configurable for file name
prefixes. Files with a lower priority value are considered more important and imported first. This ensures some files
are imported before others (e.g. products before prices).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintprotected IntegergetPriority(File file) Retrieves the priority for a file.voidsetPrefixPriority(Map<String, Integer> prefixPriority) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
FileOrderComparator
public FileOrderComparator()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
compare
- Specified by:
comparein interfaceComparator<File>
-
getPriority
Retrieves the priority for a file.- Parameters:
file- the file to get priority from- Returns:
- the configured priority, if one exists, otherwise the default priority
-
setPrefixPriority
- Parameters:
prefixPriority- the prefixPriority to set
-
getPrefixPriority
- Returns:
- prefixPriority
-