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 Modifier and Type Class Description protected static classProductBundleDisablePopulator.TargetType
-
Constructor Summary
Constructors Constructor Description ProductBundleDisablePopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisableProducts(BundleTemplateData data, java.util.Collection<java.lang.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 java.util.Collection<java.lang.String>extractProductCode(java.util.Collection<ProductModel> productList)Helper method to extract the product code from the given list of product.protected java.util.Collection<DisableProductBundleRuleModel>getDisableProductBundleRules(java.util.Collection<AbstractBundleRuleModel> rules)Helper method used to filter out the BundleRules to get all the DisableProductBundleRules from the given AbstractBundleRuleModel.protected java.util.Collection<java.lang.String>getDisableProducts(java.util.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(SOURCE productModel, TARGET productData)Populate 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
-
-
-
-
Method Detail
-
populate
public void populate(SOURCE productModel, TARGET productData) throws ConversionException
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
protected boolean hasBundleRules(ProductModel productModel)
-
hasBundleTemplates
protected boolean hasBundleTemplates(ProductData productData)
-
getDisableProducts
protected java.util.Collection<java.lang.String> getDisableProducts(java.util.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
protected java.util.Collection<java.lang.String> extractProductCode(java.util.Collection<ProductModel> productList)
Helper method to extract the product code from the given list of product.- Parameters:
productList-- Returns:
- List of product code as string.
-
getDisableProductBundleRules
protected java.util.Collection<DisableProductBundleRuleModel> getDisableProductBundleRules(java.util.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
protected void disableProducts(BundleTemplateData data, java.util.Collection<java.lang.String> disableProduct)
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
-
-