Class FirstVariantCategoryNameListValueProvider
java.lang.Object
de.hybris.platform.solrfacetsearch.provider.impl.AbstractPropertyFieldValueProvider
de.hybris.platform.commerceservices.search.solrfacetsearch.provider.AbstractMultidimensionalProductFieldValueProvider
de.hybris.platform.commerceservices.search.solrfacetsearch.provider.impl.FirstVariantCategoryNameListValueProvider
- All Implemented Interfaces:
FieldValueProvider
public class FirstVariantCategoryNameListValueProvider
extends AbstractMultidimensionalProductFieldValueProvider
Value Provider for first level of categories for multidimensional products.
-
Field Summary
Fields inherited from class de.hybris.platform.solrfacetsearch.provider.impl.AbstractPropertyFieldValueProvider
i18nService, localeService, modelService, rangeNameProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCategories(SortedMap<VariantValueCategoryModel, GenericVariantProductModel> categoryValues, GenericVariantProductModel variant) Add first level category fromvarianttocategoryValues.getFieldValue(ProductModel product) protected List<VariantValueCategoryModel>getVariantList(GenericVariantProductModel variant) Get the list ofVariantValueCategoryModelfor a givenGenericVariantProductModel.protected booleanisCurrentListPrecedent(List<VariantValueCategoryModel> currentCategoryValues, List<VariantValueCategoryModel> oldCategoryValues) Compare two category lists (previously sorted by priority) to check if the categories in the current one are previous to the old one.
e.g.: IfcurrentCategoryValueshas sequences [3,4,5] andoldCategoryValueshas sequences [3,5,4], thencurrentCategoryValuesis previous (on first level, 3 == 3, but on second level 4 < 5).voidsetCategoryManager(SolrFirstVariantCategoryManager categoryManager) voidsetVariantValueCategoryModelPriorityComparator(Comparator<VariantValueCategoryModel> variantValueCategoryModelPriorityComparator) voidsetVariantValueCategoryModelSequenceComparator(Comparator<VariantValueCategoryModel> variantValueCategoryModelSequenceComparator) Methods inherited from class de.hybris.platform.commerceservices.search.solrfacetsearch.provider.AbstractMultidimensionalProductFieldValueProvider
addFieldValues, getBaseProduct, getFieldNameProvider, getFieldValues, isVariantBaseProduct, setFieldNameProviderMethods inherited from class de.hybris.platform.solrfacetsearch.provider.impl.AbstractPropertyFieldValueProvider
getRangeNameList, getRangeNameList, setI18nService, setLocaleService, setModelService, setRangeNameProvider
-
Constructor Details
-
FirstVariantCategoryNameListValueProvider
public FirstVariantCategoryNameListValueProvider()
-
-
Method Details
-
getFieldValue
- Specified by:
getFieldValuein classAbstractMultidimensionalProductFieldValueProvider
-
addCategories
protected void addCategories(SortedMap<VariantValueCategoryModel, GenericVariantProductModel> categoryValues, GenericVariantProductModel variant) Add first level category fromvarianttocategoryValues. If there is already a first level category with higher precedence, nothing is added.- Parameters:
categoryValues- The map to be populated.variant- The variant that contains the categories.
-
getVariantList
Get the list ofVariantValueCategoryModelfor a givenGenericVariantProductModel.- Parameters:
variant- The variant that contains the categories.- Returns:
- A list of categories sorted by priority.
-
isCurrentListPrecedent
protected boolean isCurrentListPrecedent(List<VariantValueCategoryModel> currentCategoryValues, List<VariantValueCategoryModel> oldCategoryValues) Compare two category lists (previously sorted by priority) to check if the categories in the current one are previous to the old one.
e.g.: IfcurrentCategoryValueshas sequences [3,4,5] andoldCategoryValueshas sequences [3,5,4], thencurrentCategoryValuesis previous (on first level, 3 == 3, but on second level 4 < 5).- Parameters:
currentCategoryValues- Current category list.oldCategoryValues- Existent category list to compare with.- Returns:
trueifcurrentCategoryValuescategories are in lower sequence thanoldCategoryValues.
-
getVariantValueCategoryModelPriorityComparator
-
setVariantValueCategoryModelPriorityComparator
public void setVariantValueCategoryModelPriorityComparator(Comparator<VariantValueCategoryModel> variantValueCategoryModelPriorityComparator) -
getVariantValueCategoryModelSequenceComparator
-
setVariantValueCategoryModelSequenceComparator
public void setVariantValueCategoryModelSequenceComparator(Comparator<VariantValueCategoryModel> variantValueCategoryModelSequenceComparator) -
getCategoryManager
-
setCategoryManager
-