com.elasticpath.domain.catalogview
Interface Sorter

All Superinterfaces:
EpDomain, java.io.Serializable, Transient
All Known Implementing Classes:
FeaturedProductSorterImpl, PriceSorterImpl, ProductNameSorterImpl, TopSellerSorterImpl

public interface Sorter
extends Transient

Represents a sorter.


Field Summary
static java.lang.String ASC
          The suffix string to mark ascending sequence in query strings.
static java.lang.String DSC
          The suffix string to mark descending sequence in query strings.
 
Method Summary
 java.lang.String getId()
          Returns the id of the sorter.
 void initialize(java.lang.String sorterId)
          Sets the sorter id and initialize the sorter.
 java.util.List sort(java.util.List products)
          Sorts the given list of products and return the sorted list.
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

ASC

static final java.lang.String ASC
The suffix string to mark ascending sequence in query strings.

See Also:
Constant Field Values

DSC

static final java.lang.String DSC
The suffix string to mark descending sequence in query strings.

See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
Returns the id of the sorter. Every sorter has a unique id.

Returns:
the id of the sorter

initialize

void initialize(java.lang.String sorterId)
                throws EpCatalogViewRequestBindException
Sets the sorter id and initialize the sorter.

Parameters:
sorterId - the id to set
Throws:
EpCatalogViewRequestBindException - when the given sorter id is invalid

sort

java.util.List sort(java.util.List products)
Sorts the given list of products and return the sorted list.

Parameters:
products - the list of products to sort
Returns:
the sorted list