com.remondis.limbus.monitoring.PatternSpecifityComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of limbus-monitoring Show documentation
Show all versions of limbus-monitoring Show documentation
API to create and process monitoring information using extendable interfaces for consumers and producers.
The newest version!
package com.remondis.limbus.monitoring;
import java.util.Comparator;
import com.remondis.limbus.utils.Lang;
public class PatternSpecifityComparator implements Comparator {
@Override
public int compare(Pattern o1, Pattern o2) {
return compareSpecifity(o1, o2);
}
public static int compareSpecifity(Pattern o1, Pattern o2) {
Lang.denyNull("o1", o1);
Lang.denyNull("o2", o2);
if (o1.getPattern()
.length() < o2.getPattern()
.length()) {
return -1;
} else if (o1.getPattern()
.length() > o2.getPattern()
.length()) {
return 1;
} else {
return 0;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy