Class ProductBundleDisablePopulator<SOURCE extends ProductModel,TARGET extends ProductData>
java.lang.Object
de.hybris.platform.commercefacades.product.converters.populator.AbstractProductPopulator<SOURCE,TARGET>
de.hybris.platform.configurablebundlefacades.converters.populator.ProductBundleDisablePopulator<SOURCE,TARGET>
- Type Parameters:
SOURCE- ProductModelTARGET- ProductData
- All Implemented Interfaces:
Populator<SOURCE,TARGET>
public class ProductBundleDisablePopulator<SOURCE extends ProductModel,TARGET extends ProductData>
extends AbstractProductPopulator<SOURCE,TARGET>
ProductBundleDisablePopulator to populate product visibility information based on DisableProductBundleRule.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddisableProducts(BundleTemplateData data, Collection<String> disableProduct) Method which encapsulates the logic to populate the product visibility information if the given product is the part ofAbstractBundleRuleModel.getTargetProducts()orAbstractBundleRuleModel.getConditionalProducts()protected Collection<String>extractProductCode(Collection<ProductModel> productList) Helper method to extract the product code from the given list of product.protected Collection<DisableProductBundleRuleModel>Helper method used to filter out the BundleRules to get all the DisableProductBundleRules from the given AbstractBundleRuleModel.protected Collection<String>getDisableProducts(Collection<DisableProductBundleRuleModel> disableRules, ProductBundleDisablePopulator.TargetType targetType) Method to extract the product code that are eligible to apply disable ruleprotected booleanhasBundleRules(ProductModel productModel) protected booleanhasBundleTemplates(ProductData productData) voidPopulate the target instance with values from the source instance.Methods inherited from class de.hybris.platform.commercefacades.product.converters.populator.AbstractProductPopulator
getModelService, getProductAttribute, safeToString, setModelService
-
Constructor Details
-
ProductBundleDisablePopulator
public ProductBundleDisablePopulator()
-
-
Method Details
-
populate
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Parameters:
productModel- the source objectproductData- the target to fill- Throws:
ConversionException- if an error occurs
-
hasBundleRules
-
hasBundleTemplates
-
getDisableProducts
protected Collection<String> getDisableProducts(Collection<DisableProductBundleRuleModel> disableRules, ProductBundleDisablePopulator.TargetType targetType) Method to extract the product code that are eligible to apply disable rule- Parameters:
disableRules- DisableProductBundleRuleModeltargetType- TargetType- Returns:
- List of product code as string.
-
extractProductCode
Helper method to extract the product code from the given list of product.- Parameters:
productList-- Returns:
- List of product code as string.
-
getDisableProductBundleRules
protected Collection<DisableProductBundleRuleModel> getDisableProductBundleRules(Collection<AbstractBundleRuleModel> rules) Helper method used to filter out the BundleRules to get all the DisableProductBundleRules from the given AbstractBundleRuleModel.- Parameters:
rules- AbstractBundleRuleModel which holds all the rules related to the bundle.- Returns:
- List of DisableProductBundleRuleModel
-
disableProducts
Method which encapsulates the logic to populate the product visibility information if the given product is the part ofAbstractBundleRuleModel.getTargetProducts()orAbstractBundleRuleModel.getConditionalProducts()- Parameters:
data- BundleData belongs to the productdisableProduct- List of product code that needs to be disabled
-