Class ServiceComparator

java.lang.Object
org.codice.ddf.platform.util.ServiceComparator
All Implemented Interfaces:
Serializable, Comparator<org.osgi.framework.ServiceReference>

public class ServiceComparator extends Object implements Comparator<org.osgi.framework.ServiceReference>, Serializable
Comparator for OSGi ServiceReference objects.
See Also:
  • Constructor Details

    • ServiceComparator

      public ServiceComparator()
  • Method Details

    • compare

      public int compare(org.osgi.framework.ServiceReference ref1, org.osgi.framework.ServiceReference ref2)
      Compares this ServiceReference with the specified ServiceReference for order using the OSGi ServiceReference compare method.

      If this ServiceReference and the specified ServiceReference have the same service id they are equal. This ServiceReference is less than the specified ServiceReference if it has a lower service ranking and greater if it has a higher service ranking. Otherwise, if this ServiceReference and the specified ServiceReference have the same service ranking, this ServiceReference is less than the specified ServiceReference if it has a higher service id and greater if it has a lower service id.

      Specified by:
      compare in interface Comparator<org.osgi.framework.ServiceReference>