use of com.sequenceiq.cloudbreak.api.model.PlatformSecurityGroupsResponse in project cloudbreak by hortonworks.
the class CloudSecurityGroupsToPlatformSecurityGroupsResponseConverter method convert.
@Override
public PlatformSecurityGroupsResponse convert(CloudSecurityGroups source) {
Map<String, Set<PlatformSecurityGroupResponse>> result = new HashMap<>();
for (Entry<String, Set<CloudSecurityGroup>> entry : source.getCloudSecurityGroupsResponses().entrySet()) {
Set<PlatformSecurityGroupResponse> securityGroupResponses = new HashSet<>();
for (CloudSecurityGroup securityGroup : entry.getValue()) {
PlatformSecurityGroupResponse actual = new PlatformSecurityGroupResponse(securityGroup.getGroupName(), securityGroup.getGroupId(), securityGroup.getProperties());
securityGroupResponses.add(actual);
}
result.put(entry.getKey(), securityGroupResponses);
}
return new PlatformSecurityGroupsResponse(result);
}
Aggregations