Class DefaultCategoryResolutionStrategy
- java.lang.Object
-
- de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultCategoryResolutionStrategy
-
- All Implemented Interfaces:
PromotionMessageParameterResolutionStrategy
public class DefaultCategoryResolutionStrategy extends java.lang.Object implements PromotionMessageParameterResolutionStrategy
DefaultCategoryResolutionStrategy resolves the givenRuleParameterData.getValue()into a category code, looks up the category via and invokesgetCategoryRepresentation(CategoryModel)to display the category.
-
-
Constructor Summary
Constructors Constructor Description DefaultCategoryResolutionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CategoryModelgetCategory(java.lang.String categoryCode)retrieves a Category based on the givencategoryCode.protected java.lang.StringgetCategoryRepresentation(CategoryModel category)returns theCategoryModel.getName()for the givencategory.protected CategoryServicegetCategoryService()java.lang.StringgetValue(RuleParameterData data, PromotionResultModel promotionResult, java.util.Locale locale)resolves the givenRuleParameterDatainto a displayable Object.voidsetCategoryService(CategoryService categoryService)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.promotionengineservices.promotionengine.PromotionMessageParameterResolutionStrategy
getReplacedParameter
-
-
-
-
Method Detail
-
getValue
public java.lang.String getValue(RuleParameterData data, PromotionResultModel promotionResult, java.util.Locale locale)
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
protected CategoryModel getCategory(java.lang.String categoryCode)
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.
-
getCategoryRepresentation
protected java.lang.String getCategoryRepresentation(CategoryModel category)
returns theCategoryModel.getName()for the givencategory.- Parameters:
category- the category- Returns:
- the name of the category
-
getCategoryService
protected CategoryService getCategoryService()
-
setCategoryService
public void setCategoryService(CategoryService categoryService)
-
-