Class FacetImpl

java.lang.Object
com.day.cq.search.facets.extractors.FacetImpl
All Implemented Interfaces:
Facet

public class FacetImpl extends Object implements Facet
FacetImpl is a simple implementation of the Facet interface, which basically holds a collection of Buckets.

Note that this class resides in a public package (OSGi) for easy reuse of custom FacetExtractors.

Since:
5.2
  • Constructor Details

    • FacetImpl

      public FacetImpl()
      Creates a facet without any buckets. Use addBucket(Bucket) to add buckets one by one.
    • FacetImpl

      public FacetImpl(Collection<? extends Bucket> buckets)
      Creates a facet with a given list of buckets.
  • Method Details

    • addBucket

      public void addBucket(Bucket bucket)
      Adds a bucket to the list of buckets that will be returned in getBuckets().
    • getBuckets

      public List<Bucket> getBuckets()
      Description copied from interface: Facet
      Returns the buckets for this facet.
      Specified by:
      getBuckets in interface Facet
      Returns:
      the buckets for this facet.
    • getContainsHit

      public boolean getContainsHit()
      Specified by:
      getContainsHit in interface Facet
      Returns:
      true if any of the buckets contains a hit, false otherwise.