Search in sources :

Example 1 with CategoryInfo

use of com.emc.vipr.model.catalog.CategoryInfo in project coprhd-controller by CoprHD.

the class ApiMapperUtils method newCategoryInfo.

public static CategoryInfo newCategoryInfo(CatalogCategoryRestRep category) {
    CategoryInfo it = new CategoryInfo();
    it.setId(category.getId().toString());
    it.setLink(Link.newSelfLink(categoryUrl(category.getId().toString())));
    it.setInactive(category.getInactive());
    it.setName(category.getName());
    it.setTitle(category.getTitle());
    it.setDescription(category.getDescription());
    it.setImage(category.getImage());
    List<CatalogCategoryRestRep> subCatalogCategories = CatalogCategoryUtils.getCatalogCategories(category);
    for (CatalogCategoryRestRep subCatalogCategory : subCatalogCategories) {
        it.getSubCategories().add(newNamedReference(subCatalogCategory));
    }
    List<CatalogServiceRestRep> catalogServices = CatalogServiceUtils.getCatalogServices(category);
    for (CatalogServiceRestRep catalogService : catalogServices) {
        it.getServices().add(newServiceInfo(catalogService));
    }
    return it;
}
Also used : CategoryInfo(com.emc.vipr.model.catalog.CategoryInfo) CatalogServiceRestRep(com.emc.vipr.model.catalog.CatalogServiceRestRep) CatalogCategoryRestRep(com.emc.vipr.model.catalog.CatalogCategoryRestRep)

Aggregations

CatalogCategoryRestRep (com.emc.vipr.model.catalog.CatalogCategoryRestRep)1 CatalogServiceRestRep (com.emc.vipr.model.catalog.CatalogServiceRestRep)1 CategoryInfo (com.emc.vipr.model.catalog.CategoryInfo)1