public class ServiceUtil
extends java.lang.Object
ServiceUtil
is a utility class providing some
useful utility methods for service handling.Constructor and Description |
---|
ServiceUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Comparable<java.lang.Object> |
getComparableForServiceRanking(java.util.Map<java.lang.String,java.lang.Object> props)
Deprecated.
Use
getComparableForServiceRanking(Map, Order) instead. |
static java.lang.Comparable<java.lang.Object> |
getComparableForServiceRanking(java.util.Map<java.lang.String,java.lang.Object> props,
Order order)
Create a comparable object out of the service properties.
|
@Deprecated public static java.lang.Comparable<java.lang.Object> getComparableForServiceRanking(java.util.Map<java.lang.String,java.lang.Object> props)
getComparableForServiceRanking(Map, Order)
instead.props
- The service properties.getComparableForServiceRanking(Map, Order.ASCENDING)
getComparableForServiceRanking(Map, Order)
public static java.lang.Comparable<java.lang.Object> getComparableForServiceRanking(java.util.Map<java.lang.String,java.lang.Object> props, Order order)
ServiceReference.compareTo(Object)
.
The comparator will return the services in the given order. In ascending order the
service with the lowest ranking comes first, in descending order the service with the
highest ranking comes first. The latter is useful if you want to have the service
returned first which is also chosen by BundleContext.getServiceReference(String)
.props
- The service properties.order
- The order (either ascending or descending).Copyright © 2022 The Apache Software Foundation. All rights reserved.