Class DefaultCategoryResolutionStrategy
java.lang.Object
de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultCategoryResolutionStrategy
- All Implemented Interfaces:
PromotionMessageParameterResolutionStrategy
public class DefaultCategoryResolutionStrategy
extends Object
implements PromotionMessageParameterResolutionStrategy
DefaultCategoryResolutionStrategy resolves the given
RuleParameterData.getValue() into a category code, looks
up the category via and invokes getCategoryRepresentation(CategoryModel) to display the category.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CategoryModelgetCategory(String categoryCode) retrieves a Category based on the givencategoryCode.protected StringgetCategoryRepresentation(CategoryModel category) returns theCategoryModel.getName()for the givencategory.protected CategoryServicegetValue(RuleParameterData data, PromotionResultModel promotionResult, Locale locale) resolves the givenRuleParameterDatainto a displayable Object.protected booleanisSupportedCategory(CategoryModel categoryModel) voidsetCategoryService(CategoryService categoryService) 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
-
DefaultCategoryResolutionStrategy
public DefaultCategoryResolutionStrategy()
-
-
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()
-
getCategory
retrieves a Category based on the givencategoryCode. This method uses theCategoryService.getCategoryForCode(String)method.- Parameters:
categoryCode- the category code- Returns:
- the category or null if none (or multiple) are found.
-
isSupportedCategory
-
getCategoryRepresentation
returns theCategoryModel.getName()for the givencategory.- Parameters:
category- the category- Returns:
- the name of the category
-
getCategoryService
-
setCategoryService
-