Class FacetImpl

  • All Implemented Interfaces:
    Facet

    public class FacetImpl
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      FacetImpl()
      Creates a facet without any buckets.
      FacetImpl​(java.util.Collection<? extends Bucket> buckets)
      Creates a facet with a given list of buckets.
    • Constructor Detail

      • FacetImpl

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

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

      • addBucket

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

        public java.util.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.