eu.xenit.apix.configuration.ConfigurationFileComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apix-interface Show documentation
Show all versions of apix-interface Show documentation
Xenit API-X Java interface
package eu.xenit.apix.configuration;
import eu.xenit.apix.filefolder.NodePath;
import java.util.Comparator;
public class ConfigurationFileComparator implements Comparator {
private String buildString(ConfigurationFile toString) {
//The reason multiple different spaces are returned is: being more deterministic.
if (toString == null) {
return "";
}
NodePath path = toString.getPath();
if (path == null) {
return " ";
}
String displayPath = path.getDisplayPath();
if (displayPath == null) {
return " ";
}
return displayPath;
}
@Override
public int compare(ConfigurationFile first, ConfigurationFile second) {
return buildString(first).compareTo(buildString(second));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy