use of org.springframework.cloud.service.CompositeServiceInfo in project spring-cloud-connectors by spring-cloud.
the class ServiceConnectorCreatorRegistry method flatten.
private static List<ServiceInfo> flatten(List<ServiceInfo> serviceInfos) {
List<ServiceInfo> flattened = new ArrayList<ServiceInfo>();
for (ServiceInfo serviceInfo : serviceInfos) {
if (serviceInfo instanceof CompositeServiceInfo) {
// recursively flatten any CompositeServiceInfos
CompositeServiceInfo compositeServiceInfo = (CompositeServiceInfo) serviceInfo;
flattened.addAll(flatten(compositeServiceInfo.getServiceInfos()));
} else {
flattened.add(serviceInfo);
}
}
return flattened;
}
Aggregations