}
return stackJson;
}
public StackJson convert(Stack entity, StackDescription description) {
StackJson stackJson = new StackJson();
stackJson.setTemplateId(entity.getTemplate().getId());
stackJson.setNodeCount(entity.getNodeCount());
stackJson.setId(entity.getId());
stackJson.setName(entity.getName());
stackJson.setOwner(entity.getOwner());
stackJson.setAccount(entity.getAccount());
stackJson.setPublicInAccount(entity.isPublicInAccount());
stackJson.setCredentialId(entity.getCredential().getId());
stackJson.setCloudPlatform(entity.getTemplate().cloudPlatform());
stackJson.setDescription(description);
stackJson.setStatus(entity.getStatus());
stackJson.setHash(entity.getHash());
stackJson.setStatusReason(entity.getStatusReason());
stackJson.setMetadata(metaDataConverter.convertAllEntityToJson(entity.getInstanceMetaData()));
stackJson.setAmbariServerIp(entity.getAmbariIp());
if (entity.getCluster() != null) {
stackJson.setCluster(clusterConverter.convert(entity.getCluster(), "{}"));
} else {
stackJson.setCluster(new ClusterResponse());
}
return stackJson;
}