Class ProductBundleDisablePopulator<SOURCE extends ProductModel,​TARGET extends ProductData>

  • Type Parameters:
    SOURCE - ProductModel
    TARGET - 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.
    • Constructor Detail

      • ProductBundleDisablePopulator

        public ProductBundleDisablePopulator()
    • Method Detail

      • populate

        public void populate​(SOURCE productModel,
                             TARGET productData)
                      throws ConversionException
        Description copied from interface: Populator
        Populate the target instance with values from the source instance.
        Parameters:
        productModel - the source object
        productData - 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 - DisableProductBundleRuleModel
        targetType - 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