Class ServiceProcessor.DescriptorComparitor
- java.lang.Object
-
- org.glassfish.hk2.metadata.generator.ServiceProcessor.DescriptorComparitor
-
- All Implemented Interfaces:
java.util.Comparator<DescriptorImpl>
- Enclosing class:
- ServiceProcessor
private static class ServiceProcessor.DescriptorComparitor extends java.lang.Object implements java.util.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 Modifier Constructor Description private
DescriptorComparitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(DescriptorImpl o1, DescriptorImpl o2)
private static int
compareStringMaps(java.util.Set<java.lang.String> s1, java.util.Set<java.lang.String> s2)
private static <T> int
safeCompare(java.lang.Comparable<T> a, T b)
-
-
-
Method Detail
-
safeCompare
private static <T> int safeCompare(java.lang.Comparable<T> a, T b)
-
compareStringMaps
private static int compareStringMaps(java.util.Set<java.lang.String> s1, java.util.Set<java.lang.String> s2)
-
compare
public int compare(DescriptorImpl o1, DescriptorImpl o2)
- Specified by:
compare
in interfacejava.util.Comparator<DescriptorImpl>
-
-