Package jenkins.branch
Class DescriptorOrder<T extends Describable<T>>
- java.lang.Object
-
- jenkins.branch.DescriptorOrder<T>
-
- Type Parameters:
T
- the type ofDescribable
.
- All Implemented Interfaces:
Comparator<T>
public class DescriptorOrder<T extends Describable<T>> extends Object implements Comparator<T>
AComparator
that comparesDescribable
instances of a specific type based on the order of theirDescriptor
s inJenkins
's list ofDescriptor
s for that type.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T o1, T o2)
static <T extends Describable<T>>
Comparator<T>forward(Class<T> type)
Returns aComparator
that matches the order of the correspondingJenkins.getDescriptorList(Class)
.static <T extends Describable<T>>
Comparator<T>reverse(Class<T> type)
Returns aComparator
that reverses the order of the correspondingJenkins.getDescriptorList(Class)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
forward
public static <T extends Describable<T>> Comparator<T> forward(Class<T> type)
Returns aComparator
that matches the order of the correspondingJenkins.getDescriptorList(Class)
.- Type Parameters:
T
- the type ofDescribable
.- Parameters:
type
- the type ofDescribable
.- Returns:
- a
Comparator
.
-
reverse
public static <T extends Describable<T>> Comparator<T> reverse(Class<T> type)
Returns aComparator
that reverses the order of the correspondingJenkins.getDescriptorList(Class)
.- Type Parameters:
T
- the type ofDescribable
.- Parameters:
type
- the type ofDescribable
.- Returns:
- a
Comparator
.
-
compare
public int compare(T o1, T o2)
- Specified by:
compare
in interfaceComparator<T extends Describable<T>>
-
-