Class ItemtypeSortStatementFormatter
java.lang.Object
de.hybris.platform.cms2.cmsitems.service.impl.ItemtypeSortStatementFormatter
- All Implemented Interfaces:
SortStatementFormatter
Since Itemtype is of type
ComposedTypeModel, a custom SortStatementFormatter is needed to sort the
itemtype by code. The default formatter DefaultSortStatementFormatter would sort the itemtypes using their
PKs, which is not the expected behaviour.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatSortStatement(Sort sort) Format the sort parameter of the providedSortobject.booleanisApplicable(AttributeDescriptorModel attributeDescriptor) Determines if a custom sort statement formatter should be applied given theAttributeDescriptorModelprovided.
-
Constructor Details
-
ItemtypeSortStatementFormatter
public ItemtypeSortStatementFormatter()
-
-
Method Details
-
isApplicable
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
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
-