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