Class ItemtypeSortStatementFormatter
- java.lang.Object
-
- de.hybris.platform.cms2.cmsitems.service.impl.ItemtypeSortStatementFormatter
-
- All Implemented Interfaces:
SortStatementFormatter
public class ItemtypeSortStatementFormatter extends java.lang.Object implements SortStatementFormatter
Since Itemtype is of typeComposedTypeModel, a customSortStatementFormatteris needed to sort the itemtype by code. The default formatterDefaultSortStatementFormatterwould sort the itemtypes using their PKs, which is not the expected behaviour.
-
-
Constructor Summary
Constructors Constructor Description ItemtypeSortStatementFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringformatSortStatement(Sort sort)Format the sort parameter of the providedSortobject.booleanisApplicable(AttributeDescriptorModel attributeDescriptor)Determines if a custom sort statement formatter should be applied given theAttributeDescriptorModelprovided.
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(AttributeDescriptorModel attributeDescriptor)
Description copied from interface:SortStatementFormatterDetermines if a custom sort statement formatter should be applied given theAttributeDescriptorModelprovided.- Specified by:
isApplicablein interfaceSortStatementFormatter- Parameters:
attributeDescriptor- the attribute descriptor model used to evaluate the condition- Returns:
- true when the condition is met and the sort parameter should be formatted using
SortStatementFormatter.formatSortStatement(Sort); false otherwise
-
formatSortStatement
public java.lang.String formatSortStatement(Sort sort)
Description copied from interface:SortStatementFormatterFormat the sort parameter of the providedSortobject.- Specified by:
formatSortStatementin interfaceSortStatementFormatter- Parameters:
sort- the Sort object containing the sort parameter and direction- Returns:
- the formatted sort parameter
-
-