Class SortOption
java.lang.Object
com.broadleafcommerce.search.api.domain.SortOption
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable
public class SortOption
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
A sorting option for a particular field. This sort can be performed in either ascending or
descending order.
Since 2.1.0-GA, SortOptions are managed as independent entities from FieldDefinitions rather than being embedded.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanMiscellaneous attributes for this sort option.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.The display order of this sort optiongetField()The field to be sorted on.getId()The context ID of the sort option.getLabel()The label of this search optiongetName()Name to use to identify the sort option.The field variant type which should be sorted on.inthashCode()voidsetAttributes(Map<String, Object> attributes) Miscellaneous attributes for this sort option.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetDisplayOrder(Integer displayOrder) The display order of this sort optionvoidThe field to be sorted on.voidThe context ID of the sort option.voidThe label of this search optionvoidName to use to identify the sort option.voidsetVariantType(String variantType) The field variant type which should be sorted on.toString()
-
Constructor Details
-
SortOption
public SortOption()
-
-
Method Details
-
getFieldDefinitionId
-
getFieldIndexableType
-
getId
The context ID of the sort option.- Returns:
- the context ID of the sort option
-
getLabel
The label of this search option- Returns:
- label of this search option
-
getName
Name to use to identify the sort option. Typically, this should correspond to aFieldDefinition.getAbbreviation().- Returns:
- Name to use to identify the sort option.
-
getField
The field to be sorted on. Onlyid,indexableType, andlabelare serialized in API responses.- Returns:
- field to be sorted on
-
getVariantType
The field variant type which should be sorted on. -
getDisplayOrder
The display order of this sort option- Returns:
- the order to display this sort option
-
getAttributes
Miscellaneous attributes for this sort option.- Returns:
- Miscellaneous attributes for this sort option.
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
The context ID of the sort option.- Parameters:
id- the context ID of the sort option
-
setLabel
The label of this search option- Parameters:
label- label of this search option
-
setName
Name to use to identify the sort option. Typically, this should correspond to aFieldDefinition.getAbbreviation().- Parameters:
name- Name to use to identify the sort option.
-
setField
The field to be sorted on. Onlyid,indexableType, andlabelare serialized in API responses.- Parameters:
field- field to be sorted on
-
setVariantType
The field variant type which should be sorted on. -
setDisplayOrder
The display order of this sort option- Parameters:
displayOrder- the order to display this sort option
-
setAttributes
Miscellaneous attributes for this sort option.- Parameters:
attributes- Miscellaneous attributes for this sort option.
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-