Class FacetImpl
java.lang.Object
com.day.cq.search.facets.extractors.FacetImpl
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCreates a facet without any buckets.FacetImpl(Collection<? extends Bucket> buckets) Creates a facet with a given list of buckets. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a bucket to the list of buckets that will be returned ingetBuckets().Returns the buckets for this facet.boolean
-
Constructor Details
-
FacetImpl
public FacetImpl()Creates a facet without any buckets. UseaddBucket(Bucket)to add buckets one by one. -
FacetImpl
Creates a facet with a given list of buckets.
-
-
Method Details
-
addBucket
Adds a bucket to the list of buckets that will be returned ingetBuckets(). -
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.
-