Search in sources :

Example 1 with TemplateResponse

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

the class TemplateToTemplateResponseConverter method convert.

@Override
public TemplateResponse convert(Template source) {
    TemplateResponse templateJson = new TemplateResponse();
    templateJson.setId(source.getId());
    templateJson.setName(source.getName());
    templateJson.setVolumeCount(source.getVolumeCount());
    templateJson.setVolumeSize(source.getVolumeSize());
    templateJson.setPublicInAccount(source.isPublicInAccount());
    templateJson.setInstanceType(source.getInstanceType());
    templateJson.setVolumeType(source.getVolumeType());
    Json attributes = source.getAttributes();
    if (attributes != null) {
        templateJson.setParameters(attributes.getMap());
    }
    templateJson.setCloudPlatform(source.cloudPlatform());
    templateJson.setDescription(source.getDescription() == null ? "" : source.getDescription());
    if (source.getTopology() != null) {
        templateJson.setTopologyId(source.getTopology().getId());
    }
    return templateJson;
}
Also used : TemplateResponse(com.sequenceiq.cloudbreak.api.model.TemplateResponse) Json(com.sequenceiq.cloudbreak.domain.json.Json)

Aggregations

TemplateResponse (com.sequenceiq.cloudbreak.api.model.TemplateResponse)1 Json (com.sequenceiq.cloudbreak.domain.json.Json)1