public class RefComparator extends Object implements Comparator<Ref>
Useful for command line tools or writing out refs to file.
Modifier and Type | Field and Description |
---|---|
static RefComparator |
INSTANCE
Singleton instance of RefComparator
|
Constructor and Description |
---|
RefComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Ref o1,
Ref o2) |
static int |
compareTo(Ref o1,
Ref o2)
Compare two references by name.
|
static int |
compareTo(Ref o1,
String o2)
Compare a reference to a name.
|
static Collection<Ref> |
sort(Collection<Ref> refs)
Sorts the collection of refs, returning a new collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final RefComparator INSTANCE
public int compare(Ref o1, Ref o2)
compare
in interface Comparator<Ref>
public static Collection<Ref> sort(Collection<Ref> refs)
refs
- collection to be sortedpublic static int compareTo(Ref o1, String o2)
o1
- the reference instance.o2
- the name to compare to.Copyright © 2021 Eclipse JGit Project. All rights reserved.