Class DefaultProductResolutionStrategy
java.lang.Object
de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultProductResolutionStrategy
- All Implemented Interfaces:
PromotionMessageParameterResolutionStrategy
public class DefaultProductResolutionStrategy
extends Object
implements PromotionMessageParameterResolutionStrategy
DefaultProductResolutionStrategy resolves the given
RuleParameterData.getValue() into a product code, looks
up the product via and invokes getProductRepresentation(ProductModel) to display the product.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProductModelgetProduct(String productCode) retrieves a Product based on the givenproductCode.protected StringgetProductRepresentation(ProductModel product) returns theProductModel.getName()for the givenproduct.protected ProductServicegetValue(RuleParameterData data, PromotionResultModel promotionResult, Locale locale) resolves the givenRuleParameterDatainto a displayable Object.voidsetProductService(ProductService productService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.promotionengineservices.promotionengine.PromotionMessageParameterResolutionStrategy
getReplacedParameter
-
Constructor Details
-
DefaultProductResolutionStrategy
public DefaultProductResolutionStrategy()
-
-
Method Details
-
getValue
Description copied from interface:PromotionMessageParameterResolutionStrategyresolves the givenRuleParameterDatainto a displayable Object.- Specified by:
getValuein interfacePromotionMessageParameterResolutionStrategy- Parameters:
data- the rule parameter to resolvepromotionResult- the promotion resultlocale- the locale- Returns:
- an object (to be displayed via
#toString()
-
getProduct
retrieves a Product based on the givenproductCode. This method uses theProductService.getProductForCode(String)method.- Parameters:
productCode- the product's code- Returns:
- the product or null if none (or multiple) are found.
-
getProductRepresentation
returns theProductModel.getName()for the givenproduct.- Parameters:
product- the product- Returns:
- the name of the product
-
getProductService
-
setProductService
-