public final class MostSpecificComparator extends Object implements Comparator<RefConfigSection>
For example, if given refs/heads/m* and refs/heads/*, the distances are 5 and 6. It means that refs/heads/m* is more specific because it's closer to refs/heads/master than refs/heads/*.
Another example could be refs/heads/* and refs/heads/[a-zA-Z]*, the distances are both 6. Both are infinite, but refs/heads/[a-zA-Z]* has more transitions, which after all turns it more specific.
| Constructor and Description |
|---|
MostSpecificComparator(String refName) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(RefConfigSection a,
RefConfigSection b) |
int |
compare(String pattern1,
String pattern2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic MostSpecificComparator(String refName)
public int compare(RefConfigSection a, RefConfigSection b)
compare in interface Comparator<RefConfigSection>