Search in sources :

Example 1 with StackInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.StackInfo in project cloudbreak by hortonworks.

the class ImagesToImagesResponseJsonConverter method getDefaultStackInfos.

private List<StackDetailsJson> getDefaultStackInfos(Iterable<? extends StackInfo> defaultStackInfos) {
    List<StackDetailsJson> result = new ArrayList<>();
    for (StackInfo info : defaultStackInfos) {
        StackDetailsJson json = new StackDetailsJson();
        StackRepoDetailsJson repoJson = new StackRepoDetailsJson();
        Map<String, String> stackRepo = info.getRepo().getStack();
        if (stackRepo != null) {
            repoJson.setStack(stackRepo);
        }
        Map<String, String> utilRepo = info.getRepo().getUtil();
        if (utilRepo != null) {
            repoJson.setUtil(utilRepo);
        }
        Map<String, String> knoxRepo = info.getRepo().getKnox();
        if (knoxRepo != null) {
            repoJson.setKnox(knoxRepo);
        }
        json.setRepo(repoJson);
        json.setVersion(info.getVersion());
        result.add(json);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) StackDetailsJson(com.sequenceiq.cloudbreak.api.model.imagecatalog.StackDetailsJson) StackInfo(com.sequenceiq.cloudbreak.cloud.model.component.StackInfo) StackRepoDetailsJson(com.sequenceiq.cloudbreak.api.model.imagecatalog.StackRepoDetailsJson)

Aggregations

StackDetailsJson (com.sequenceiq.cloudbreak.api.model.imagecatalog.StackDetailsJson)1 StackRepoDetailsJson (com.sequenceiq.cloudbreak.api.model.imagecatalog.StackRepoDetailsJson)1 StackInfo (com.sequenceiq.cloudbreak.cloud.model.component.StackInfo)1 ArrayList (java.util.ArrayList)1