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;
}
Aggregations