Class ProductFilter

java.lang.Object
de.hybris.platform.classification.filter.ProductFilter

public class ProductFilter extends Object
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.
See Also:
  • Constructor Details

    • ProductFilter

      public ProductFilter(CategoryModel category)
      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

      public void setAttribute(ClassAttributeAssignmentModel assignment, Object value)
      Convenience method to set a filtered attribute by ClassAttributeAssignmentModel.
      Parameters:
      assignment - the assigment of the attribute
      value - the attribute value
      See Also:
    • setAttribute

      public void setAttribute(ClassificationAttributeModel attribute, Object value)
      Convenience method to set a filtered attribute by ClassificationAttributeModel.
      Parameters:
      attribute - the attribute
      value - the attribute value
      See Also:
    • setAttribute

      public void setAttribute(String attributeCode, 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's getProductsByFilter method for more information on how value are converted
      Parameters:
      attributeCode - the code of the filter attribute
      value - the value of the filter attribute
      See Also:
    • getAttributes

      public Map<String,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