Class Facet

  • All Implemented Interfaces:
    Serializable

    public class Facet
    extends Object
    implements Serializable
    This represents an available search facet and its filtering options. This can represent any property that is filterable. For example, this could represent an item like Color, Manufacturer, Price, etc.
    See Also:
    Serialized Form
    • Constructor Detail

      • Facet

        public Facet()
    • Method Detail

      • isRuledFacet

        public boolean isRuledFacet()
      • getLabel

        public String getLabel()
        A value intended for display on a UI. For example, "Manufacturer", "Price", "Category", etc.
        Returns:
        displayable label for this facet
      • getDisplayOrder

        public Integer getDisplayOrder()
        Order in which to display this facet on a list of facets. A lower number indicates this item will occur earlier in the returned facet list.
        Returns:
        order in which this facet should appear in a list
      • isMultiSelect

        public boolean isMultiSelect()
        Determines whether or not this facet allows multiple values to be selected.
        Returns:
        can multiple options of this facet be selected?
      • isRanged

        public boolean isRanged()
        Designates whether or not this facet is ranged. For example price might be a ranged facet ($0.00-49.99, $50.00-99.99, etc), or date ranges.
        Returns:
        is this a ranged facet?
      • getRanges

        public List<FacetRange> getRanges()
        The different range options available for filtering on this search facet.
        Returns:
        available range options for this facet
      • getFacetRule

        public String getFacetRule()
        The rule required to be met for this facet to be active. This is by default a SpEL expression, but may be any expression language.
        Returns:
        The facet rule.
        See Also:
        Spring SpEL documentation
      • setLabel

        public void setLabel​(String label)
        A value intended for display on a UI. For example, "Manufacturer", "Price", "Category", etc.
        Parameters:
        label - displayable label for this facet
      • setName

        public void setName​(String name)
        Name to use to identify the facet. Typically, this should correspond to a FieldDefinition.getAbbreviation().
        Parameters:
        name - Name to use to identify the facet.
      • setDisplayOrder

        public void setDisplayOrder​(Integer displayOrder)
        Order in which to display this facet on a list of facets. A lower number indicates this item will occur earlier in the returned facet list.
        Parameters:
        displayOrder - order in which this facet should appear in a list
      • setMultiSelect

        public void setMultiSelect​(boolean multiSelect)
        Determines whether or not this facet allows multiple values to be selected.
        Parameters:
        multiSelect - can multiple options of this facet be selected?
      • setRanged

        public void setRanged​(boolean ranged)
        Designates whether or not this facet is ranged. For example price might be a ranged facet ($0.00-49.99, $50.00-99.99, etc), or date ranges.
        Parameters:
        ranged - is this a ranged facet?
      • setRanges

        public void setRanges​(List<FacetRange> ranges)
        The different range options available for filtering on this search facet.
        Parameters:
        ranges - available range options for this facet
      • setFacetRule

        public void setFacetRule​(String facetRule)
        The rule required to be met for this facet to be active. This is by default a SpEL expression, but may be any expression language.
        Parameters:
        facetRule - The rule to evaluate.
        See Also:
        Spring SpEL documentation
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object