Class ServiceProcessor.DescriptorComparitor
java.lang.Object
org.glassfish.hk2.metadata.generator.ServiceProcessor.DescriptorComparitor
- All Implemented Interfaces:
Comparator<DescriptorImpl>
- Enclosing class:
ServiceProcessor
private static class ServiceProcessor.DescriptorComparitor
extends Object
implements Comparator<DescriptorImpl>
This is a comparator making things that don't really compare, compare.
It is done to ensure that given the same set of descriptors we always
return the set in the same order, which will ensure that the output
of the generator is not different from run to run
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(DescriptorImpl o1, DescriptorImpl o2) private static int
compareStringMaps
(Set<String> s1, Set<String> s2) private static <T> int
safeCompare
(Comparable<T> a, T b) 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
-
Constructor Details
-
DescriptorComparitor
private DescriptorComparitor()
-
-
Method Details
-
safeCompare
-
compareStringMaps
-
compare
- Specified by:
compare
in interfaceComparator<DescriptorImpl>
-