use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformSecurityGroupResponse in project cloudbreak by hortonworks.
the class CloudSecurityGroupsToPlatformSecurityGroupsV1ResponseConverter method convert.
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