Class CMSItemCatalogLevelComparator<T extends CMSItemModel>
- java.lang.Object
-
- de.hybris.platform.cms2.multicountry.comparator.CMSItemCatalogLevelComparator<T>
-
- All Implemented Interfaces:
java.util.Comparator<T>
public class CMSItemCatalogLevelComparator<T extends CMSItemModel> extends java.lang.Object implements java.util.Comparator<T>CompareCMSItemModelby catalog level where the cms item was defined. This is used in the context of multi-country.
-
-
Constructor Summary
Constructors Constructor Description CMSItemCatalogLevelComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(CMSItemModel item1, CMSItemModel item2)protected intcompareItemsByCatalogVersions(CMSItemModel item1, CMSItemModel item2)Determines the ordering of the given cms items by comparing the catalog versions where the items are defined.protected CatalogLevelServicegetCmsCatalogLevelService()voidsetCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService)
-
-
-
Method Detail
-
compare
public int compare(CMSItemModel item1, CMSItemModel item2)
- Specified by:
comparein interfacejava.util.Comparator<T extends CMSItemModel>
-
compareItemsByCatalogVersions
protected int compareItemsByCatalogVersions(CMSItemModel item1, CMSItemModel item2)
Determines the ordering of the given cms items by comparing the catalog versions where the items are defined. The item defined in the active catalog takes precedence.- Parameters:
item1- - the first catalog version to be compareditem2- - the second catalog version to be compared- Returns:
- The ordering of the cms item based on their catalog versions
-
getCmsCatalogLevelService
protected CatalogLevelService getCmsCatalogLevelService()
-
setCmsCatalogLevelService
public void setCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService)
-
-