public final class MostSpecificComparator extends java.lang.Object implements java.util.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(java.lang.String refName) |
Modifier and Type | Method and Description |
---|---|
int |
compare(RefConfigSection a,
RefConfigSection b) |
int |
compare(java.lang.String pattern1,
java.lang.String pattern2) |
public int compare(RefConfigSection a, RefConfigSection b)
compare
in interface java.util.Comparator<RefConfigSection>
public int compare(java.lang.String pattern1, java.lang.String pattern2)