Class ProductFilter
java.lang.Object
de.hybris.platform.classification.filter.ProductFilter
A product filter defined in terms of a category and a number classification attribute code/value pairs. Also you can
provide a limit and offset. A filter must have a category but may have zero attribute/value pairs.
-
Constructor Summary
ConstructorsConstructorDescriptionProductFilter(CategoryModel category) Initialize the filter with a category. -
Method Summary
Modifier and TypeMethodDescriptionReturns all filter attributes.Returns the category of this filterintgetCount()Returns the maximum amount of items in the filter result.intgetStart()Return the start index of the filter result.voidsetAttribute(ClassAttributeAssignmentModel assignment, Object value) Convenience method to set a filtered attribute byClassAttributeAssignmentModel.voidsetAttribute(ClassificationAttributeModel attribute, Object value) Convenience method to set a filtered attribute byClassificationAttributeModel.voidsetAttribute(String attributeCode, Object value) Sets a filtered attribute.voidsetCount(int count) Sets the maximum amount of items in the filter result.voidsetStart(int start) Set the start index of the filter result.
-
Constructor Details
-
ProductFilter
Initialize the filter with a category. The category must not be null.- Parameters:
category- the filtered category- Throws:
IllegalArgumentException- when the category is null
-
-
Method Details
-
setAttribute
Convenience method to set a filtered attribute byClassAttributeAssignmentModel.- Parameters:
assignment- the assigment of the attributevalue- the attribute value- See Also:
-
setAttribute
Convenience method to set a filtered attribute byClassificationAttributeModel.- Parameters:
attribute- the attributevalue- the attribute value- See Also:
-
setAttribute
Sets a filtered attribute. The attribute is given by its code. The value must either be of the attribute's type or may be a string. See the ClassificationService'sgetProductsByFiltermethod for more information on how value are converted- Parameters:
attributeCode- the code of the filter attributevalue- the value of the filter attribute- See Also:
-
getAttributes
Returns all filter attributes. Keys are the attribute's code, value are the attribute values- Returns:
- the filter attributes
-
getCategory
Returns the category of this filter- Returns:
- the category of this filter
-
getStart
public int getStart()Return the start index of the filter result. 0 is the first index number.- Returns:
- the start index of the filter result
-
setStart
public void setStart(int start) Set the start index of the filter result. 0 is the first index number.- Parameters:
start- the start index of the filter result
-
getCount
public int getCount()Returns the maximum amount of items in the filter result. -1 denotes no maximum.- Returns:
- the maximum amount of filered items
-
setCount
public void setCount(int count) Sets the maximum amount of items in the filter result. -1 denotes no maximum.- Parameters:
count- the maximum amount of filered items
-