Class FacetImpl
- java.lang.Object
-
- com.day.cq.search.facets.extractors.FacetImpl
-
- All Implemented Interfaces:
Facet
public class FacetImpl extends java.lang.Object implements Facet
FacetImpl
is a simple implementation of theFacet
interface, which basically holds a collection ofBuckets
.Note that this class resides in a public package (OSGi) for easy reuse of custom
FacetExtractors
.- Since:
- 5.2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBucket(Bucket bucket)
Adds a bucket to the list of buckets that will be returned ingetBuckets()
.java.util.List<Bucket>
getBuckets()
Returns the buckets for this facet.boolean
getContainsHit()
-
-
-
Constructor Detail
-
FacetImpl
public FacetImpl()
Creates a facet without any buckets. UseaddBucket(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 ingetBuckets()
.
-
getBuckets
public java.util.List<Bucket> getBuckets()
Description copied from interface:Facet
Returns the buckets for this facet.- Specified by:
getBuckets
in interfaceFacet
- Returns:
- the buckets for this facet.
-
getContainsHit
public boolean getContainsHit()
- Specified by:
getContainsHit
in interfaceFacet
- Returns:
true
if any of the buckets contains a hit,false
otherwise.
-
-