Class VariantOverviewPopulator
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.facades.populator.VariantOverviewPopulator
-
- All Implemented Interfaces:
Populator<ProductModel,ConfigurationOverviewData>
public class VariantOverviewPopulator extends java.lang.Object implements Populator<ProductModel,ConfigurationOverviewData>
Takes care of transforming aProductModelobject of a variant into aConfigurationOverviewDataobject, 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 theVariantOverviewValuePopulatorto populate indivdual values.
-
-
Constructor Summary
Constructors Constructor Description VariantOverviewPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CharacteristicGroupaddGeneralGroup(ConfigurationOverviewData overviewData)Creates a general group to fulfill object hierarchy of ConfigurationOverviewData as product variants don't organize their features in groups.Populator<ProductModel,ProductData>getClassificationPopulator()FeatureProvidergetFeatureProvider()Populator<FeatureData,java.util.List<CharacteristicValue>>getVariantOverviewValuePopulator()voidpopulate(ProductModel productModel, ConfigurationOverviewData overviewData)Populate the target instance with values from the source instance.protected voidprocessFeatureList(java.util.List<FeatureData> features, java.util.List<CharacteristicValue> values)Calls the VariantOverviewValuePopulator for each FeatureData object.voidsetClassificationPopulator(Populator<ProductModel,ProductData> classificationPopulator)voidsetFeatureProvider(FeatureProvider featureProvider)voidsetVariantOverviewValuePopulator(Populator<FeatureData,java.util.List<CharacteristicValue>> variantOverviewValuePopulator)
-
-
-
Method Detail
-
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,java.util.List<CharacteristicValue>> getVariantOverviewValuePopulator()
- Returns:
- the variantOverviewValuePopulator
-
setVariantOverviewValuePopulator
public void setVariantOverviewValuePopulator(Populator<FeatureData,java.util.List<CharacteristicValue>> variantOverviewValuePopulator)
- Parameters:
variantOverviewValuePopulator- the variantOverviewValuePopulator to set
-
populate
public void populate(ProductModel productModel, ConfigurationOverviewData overviewData)
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<ProductModel,ConfigurationOverviewData>- Parameters:
productModel- the source objectoverviewData- the target to fill
-
processFeatureList
protected void processFeatureList(java.util.List<FeatureData> features, java.util.List<CharacteristicValue> values)
Calls the VariantOverviewValuePopulator for each FeatureData object.- Parameters:
features- list of FeatureData objectsvalues- 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
-
-