Class GenericVariantProductModelComparator
- java.lang.Object
-
- de.hybris.platform.commerceservices.search.solrfacetsearch.provider.entity.GenericVariantProductModelComparator
-
- All Implemented Interfaces:
java.util.Comparator<GenericVariantProductModel>
public class GenericVariantProductModelComparator extends java.lang.Object implements java.util.Comparator<GenericVariantProductModel>
Comparator for typeGenericVariantProductModel.
-
-
Constructor Summary
Constructors Constructor Description GenericVariantProductModelComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(GenericVariantProductModel variant1, GenericVariantProductModel variant2)Considers variant1 greater then other if, for the same variant category level, the value of theVariantValueCategoryModelbelonging to variant1 has a bigger sequence then theVariantValueCategoryModelbelonging to variant2.java.util.Comparator<VariantValueCategoryModel>getVariantValueCategoryModelPriorityComparator()protected java.util.List<VariantValueCategoryModel>getVariantValuesCategories(GenericVariantProductModel productModel)Get the list ofVariantValueCategoryModelrelated to a specificGenericVariantProductModel.voidsetVariantValueCategoryModelPriorityComparator(java.util.Comparator<VariantValueCategoryModel> variantValueCategoryModelPriorityComparator)
-
-
-
Method Detail
-
compare
public int compare(GenericVariantProductModel variant1, GenericVariantProductModel variant2)
Considers variant1 greater then other if, for the same variant category level, the value of theVariantValueCategoryModelbelonging to variant1 has a bigger sequence then theVariantValueCategoryModelbelonging to variant2.- Specified by:
comparein interfacejava.util.Comparator<GenericVariantProductModel>
-
getVariantValuesCategories
protected java.util.List<VariantValueCategoryModel> getVariantValuesCategories(GenericVariantProductModel productModel)
Get the list ofVariantValueCategoryModelrelated to a specificGenericVariantProductModel.- Parameters:
productModel- the variant product.- Returns:
- The variant value categories, ordered by variant category priority.
-
getVariantValueCategoryModelPriorityComparator
public java.util.Comparator<VariantValueCategoryModel> getVariantValueCategoryModelPriorityComparator()
-
setVariantValueCategoryModelPriorityComparator
public void setVariantValueCategoryModelPriorityComparator(java.util.Comparator<VariantValueCategoryModel> variantValueCategoryModelPriorityComparator)
-
-