private static String getServiceName(Class<?> clientInterface) { requireNonNull(clientInterface, "clientInterface is null"); String serviceName = getThriftServiceAnnotation(clientInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return clientInterface.getSimpleName(); }
private static String getServiceName(Class<?> serverInterface) { requireNonNull(serverInterface, "serverInterface is null"); String serviceName = getThriftServiceAnnotation(serverInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return serverInterface.getSimpleName(); }
private static String getServiceName(Class<?> clientInterface) { requireNonNull(clientInterface, "clientInterface is null"); String serviceName = getThriftServiceAnnotation(clientInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return clientInterface.getSimpleName(); }
private static String getServiceName(Class<?> serverInterface) { requireNonNull(serverInterface, "serverInterface is null"); String serviceName = getThriftServiceAnnotation(serverInterface).value(); if (!serviceName.isEmpty()) { return serviceName; } return serverInterface.getSimpleName(); }
public ThriftServiceMetadata(Class<?> serviceClass, ThriftCatalog catalog) { requireNonNull(serviceClass, "serviceClass is null"); ThriftService thriftService = getThriftServiceAnnotation(serviceClass); if (thriftService.value().isEmpty()) { name = serviceClass.getSimpleName(); } else { name = thriftService.value(); } if (thriftService.idlName().isEmpty()) { idlName = name; } else { idlName = thriftService.idlName(); } // A multimap from order to method name. Sorted by key (order), with nulls (i.e. no order) last. // Within each key, values (ThriftMethodMetadata) are sorted by method name. TreeMultimap<Integer, ThriftMethodMetadata> builder = TreeMultimap.create( Ordering.natural().nullsLast(), Ordering.natural().onResultOf(ThriftMethodMetadata::getName)); for (Method method : findAnnotatedMethods(serviceClass, ThriftMethod.class)) { if (method.isAnnotationPresent(ThriftMethod.class)) { builder.put(getMethodOrder(method), new ThriftMethodMetadata(method, catalog)); } } methods = builder.values().stream() .collect(toImmutableMap(ThriftMethodMetadata::getName, identity())); documentation = getThriftDocumentation(serviceClass); }