INNER CODE UNIT · Java
serviceTags
scalecube/scalecube-services · services-api/src/main/java/io/scalecube/services/Reflect.java:214
public static Map<String, String> serviceTags(Class<?> serviceInterface) {
return Reflect.transformArrayToMap(serviceInterface.getAnnotationsByType(Tag.class));
}
/**
* Extracts service tags from service method.
*
* @param serviceMethod serviceMethod with {@link ServiceMethod} annotation
* @return service tags
*/
public static Map<String, String> serviceMethodTags(Method serviceMethod) {
return Reflect.transformArrayToMap(serviceMethod.getAnnotationsByType(Tag.class));
}
private static Map<String, String> transformArrayToMap(Tag[] array) {
return array == null || array.length == 0
? Collections.emptyMap()
: Collections.unmodifiableMap(