INNER CODE UNIT · Java
serviceMethodTags
scalecube/scalecube-services · services-api/src/main/java/io/scalecube/services/Reflect.java:224
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(
Arrays.stream(array).collect(Collectors.toMap(Tag::key, Tag::value)));
}
/**
* Gets service method map from service api.
*
* @param serviceInterface with {@link Service} annotation
* @return service name
*/
public static Collection<Method> serviceMethods(Class<?> serviceInterface) {