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
FacetImplis a simple implementation of theFacetinterface, 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 voidaddBucket(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.booleangetContainsHit()
-
-
-
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:FacetReturns the buckets for this facet.- Specified by:
getBucketsin interfaceFacet- Returns:
- the buckets for this facet.
-
getContainsHit
public boolean getContainsHit()
- Specified by:
getContainsHitin interfaceFacet- Returns:
trueif any of the buckets contains a hit,falseotherwise.
-
-