Class ProductFilter
- java.lang.Object
-
- de.hybris.platform.classification.filter.ProductFilter
-
public class ProductFilter extends java.lang.ObjectA 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
Constructors Constructor Description ProductFilter(CategoryModel category)Initialize the filter with a category.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>getAttributes()Returns all filter attributes.CategoryModelgetCategory()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, java.lang.Object value)Convenience method to set a filtered attribute byClassAttributeAssignmentModel.voidsetAttribute(ClassificationAttributeModel attribute, java.lang.Object value)Convenience method to set a filtered attribute byClassificationAttributeModel.voidsetAttribute(java.lang.String attributeCode, java.lang.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 Detail
-
ProductFilter
public ProductFilter(CategoryModel category)
Initialize the filter with a category. The category must not be null.- Parameters:
category- the filtered category- Throws:
java.lang.IllegalArgumentException- when the category is null
-
-
Method Detail
-
setAttribute
public void setAttribute(ClassAttributeAssignmentModel assignment, java.lang.Object value)
Convenience method to set a filtered attribute byClassAttributeAssignmentModel.- Parameters:
assignment- the assigment of the attributevalue- the attribute value- See Also:
setAttribute(String, Object)
-
setAttribute
public void setAttribute(ClassificationAttributeModel attribute, java.lang.Object value)
Convenience method to set a filtered attribute byClassificationAttributeModel.- Parameters:
attribute- the attributevalue- the attribute value- See Also:
setAttribute(String, Object)
-
setAttribute
public void setAttribute(java.lang.String attributeCode, java.lang.Object value)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:
ClassificationService.getProductsByFilter(ProductFilter)
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns all filter attributes. Keys are the attribute's code, value are the attribute values- Returns:
- the filter attributes
-
getCategory
public CategoryModel 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
-
-