Search in sources :

Example 1 with AccessConfigResponseComparator

use of com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigResponseComparator in project cloudbreak by hortonworks.

the class CloudAccessConfigsToPlatformAccessConfigsV1ResponseConverter method convert.

public PlatformAccessConfigsResponse convert(CloudAccessConfigs source) {
    PlatformAccessConfigsResponse platformAccessConfigsResponse = new PlatformAccessConfigsResponse();
    List<AccessConfigResponse> result = new ArrayList<>();
    for (CloudAccessConfig entry : source.getCloudAccessConfigs()) {
        AccessConfigResponse actual = new AccessConfigResponse(entry.getName(), entry.getId(), entry.getProperties());
        result.add(actual);
    }
    result.sort(new AccessConfigResponseComparator());
    platformAccessConfigsResponse.setAccessConfigs(result);
    return platformAccessConfigsResponse;
}
Also used : AccessConfigResponseComparator(com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigResponseComparator) CloudAccessConfig(com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfig) ArrayList(java.util.ArrayList) PlatformAccessConfigsResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse) AccessConfigResponse(com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigResponse)

Aggregations

CloudAccessConfig (com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfig)1 AccessConfigResponse (com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigResponse)1 AccessConfigResponseComparator (com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigResponseComparator)1 PlatformAccessConfigsResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse)1 ArrayList (java.util.ArrayList)1