use of com.salesmanager.shop.model.catalog.product.attribute.api.ReadableProductOptionList in project shopizer by shopizer-ecommerce.
the class ProductOptionFacadeImpl method options.
@Override
public ReadableProductOptionList options(MerchantStore store, Language language, String name, int page, int count) {
Validate.notNull(store, "MerchantStore should not be null");
Page<ProductOption> options = productOptionService.getByMerchant(store, null, name, page, count);
ReadableProductOptionList valueList = new ReadableProductOptionList();
valueList.setTotalPages(options.getTotalPages());
valueList.setRecordsTotal(options.getTotalElements());
valueList.setNumber(options.getNumber());
List<ReadableProductOptionEntity> values = options.getContent().stream().map(option -> readableMapper.convert(option, store, null)).collect(Collectors.toList());
valueList.setOptions(values);
return valueList;
}
Aggregations