Search in sources :

Example 1 with PlatformGatewaysResponse

use of com.sequenceiq.cloudbreak.api.model.PlatformGatewaysResponse in project cloudbreak by hortonworks.

the class CloudGatewayssToPlatformGatewaysResponseConverter method convert.

@Override
public PlatformGatewaysResponse convert(CloudGateWays source) {
    Map<String, Set<CloudGatewayJson>> result = new HashMap<>();
    for (Entry<String, Set<CloudGateWay>> entry : source.getCloudGateWayResponses().entrySet()) {
        Set<CloudGatewayJson> cloudGatewayJsons = new HashSet<>();
        for (CloudGateWay gateway : entry.getValue()) {
            CloudGatewayJson actual = new CloudGatewayJson(gateway.getName(), gateway.getId(), gateway.getProperties());
            cloudGatewayJsons.add(actual);
        }
        result.put(entry.getKey(), cloudGatewayJsons);
    }
    return new PlatformGatewaysResponse(result);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) CloudGatewayJson(com.sequenceiq.cloudbreak.api.model.CloudGatewayJson) PlatformGatewaysResponse(com.sequenceiq.cloudbreak.api.model.PlatformGatewaysResponse) HashSet(java.util.HashSet) CloudGateWay(com.sequenceiq.cloudbreak.cloud.model.CloudGateWay)

Aggregations

CloudGatewayJson (com.sequenceiq.cloudbreak.api.model.CloudGatewayJson)1 PlatformGatewaysResponse (com.sequenceiq.cloudbreak.api.model.PlatformGatewaysResponse)1 CloudGateWay (com.sequenceiq.cloudbreak.cloud.model.CloudGateWay)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1