Class VariantOverviewPopulator

java.lang.Object
de.hybris.platform.sap.productconfig.facades.populator.VariantOverviewPopulator
All Implemented Interfaces:
Populator<ProductModel,ConfigurationOverviewData>

public class VariantOverviewPopulator extends Object implements Populator<ProductModel,ConfigurationOverviewData>
Takes care of transforming a ProductModel object of a variant into a ConfigurationOverviewData object, which is used to display the pre-selected values of the product variant.
We want to avoid to create a runtime configuration for a variant, just to display the overview page. This would be an in-performant solution. However the variant data is also available in the hybris classification data, hence we obtained it from there.
Will use the VariantOverviewValuePopulator to populate indivdual values.
  • Constructor Details

    • VariantOverviewPopulator

      public VariantOverviewPopulator()
  • Method Details

    • getFeatureProvider

      public FeatureProvider getFeatureProvider()
      Returns:
      the featureProvider
    • setFeatureProvider

      public void setFeatureProvider(FeatureProvider featureProvider)
      Parameters:
      featureProvider - the featureProvider to set
    • getClassificationPopulator

      public Populator<ProductModel,ProductData> getClassificationPopulator()
      Returns:
      the classificationPopulator
    • setClassificationPopulator

      public void setClassificationPopulator(Populator<ProductModel,ProductData> classificationPopulator)
      Parameters:
      classificationPopulator - the classificationPopulator to set
    • getVariantOverviewValuePopulator

      public Populator<FeatureData,List<CharacteristicValue>> getVariantOverviewValuePopulator()
      Returns:
      the variantOverviewValuePopulator
    • setVariantOverviewValuePopulator

      public void setVariantOverviewValuePopulator(Populator<FeatureData,List<CharacteristicValue>> variantOverviewValuePopulator)
      Parameters:
      variantOverviewValuePopulator - the variantOverviewValuePopulator to set
    • populate

      public void populate(ProductModel productModel, ConfigurationOverviewData overviewData)
      Description copied from interface: Populator
      Populate the target instance with values from the source instance.
      Specified by:
      populate in interface Populator<ProductModel,ConfigurationOverviewData>
      Parameters:
      productModel - the source object
      overviewData - the target to fill
    • processFeatureList

      protected void processFeatureList(List<FeatureData> features, List<CharacteristicValue> values)
      Calls the VariantOverviewValuePopulator for each FeatureData object.
      Parameters:
      features - list of FeatureData objects
      values - list of resulting CharacteristicValue objects
    • addGeneralGroup

      protected CharacteristicGroup addGeneralGroup(ConfigurationOverviewData overviewData)
      Creates a general group to fulfill object hierarchy of ConfigurationOverviewData as product variants don't organize their features in groups.
      Parameters:
      overviewData -
      Returns:
      general group