use of com.sequenceiq.cloudbreak.api.model.PlatformNetworksResponse in project cloudbreak by hortonworks.
the class CloudNetworksToPlatformNetworksResponseConverter method convert.
@Override
public PlatformNetworksResponse convert(CloudNetworks source) {
Map<String, Set<PlatformNetworkResponse>> result = new HashMap<>();
for (Entry<String, Set<CloudNetwork>> entry : source.getCloudNetworkResponses().entrySet()) {
Set<PlatformNetworkResponse> networks = new HashSet<>();
for (CloudNetwork cloudNetwork : entry.getValue()) {
PlatformNetworkResponse actual = new PlatformNetworkResponse(cloudNetwork.getName(), cloudNetwork.getId(), cloudNetwork.getSubnets(), cloudNetwork.getProperties());
networks.add(actual);
}
result.put(entry.getKey(), networks);
}
return new PlatformNetworksResponse(result);
}
Aggregations