Class PredefinedBucketsFacetExtractor
- java.lang.Object
-
- com.day.cq.search.facets.extractors.PropertyFacetExtractor
-
- com.day.cq.search.facets.extractors.PredefinedBucketsFacetExtractor
-
- All Implemented Interfaces:
FacetExtractor
public class PredefinedBucketsFacetExtractor extends PropertyFacetExtractor
PredefinedBucketsFacetExtractor extracts facets based on a list ofpredefined buckets
. This means that the buckets returned will at most be the ones added in theconstructor
or throughaddPredefinedBucket(PredefinedBucket)
, but could be less, because only buckets with at least one match will be returned in the facet.- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description PredefinedBucketsFacetExtractor(java.lang.String propertyRelPath)
PredefinedBucketsFacetExtractor(java.lang.String propertyRelPath, java.util.Collection<? extends PredefinedBucket> buckets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPredefinedBucket(PredefinedBucket bucket)
Adds a predefined bucket to this extractor.boolean
equals(java.lang.Object obj)
Facet
getFacet()
Called after the result set was scanned (andFacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the finalFacet
object.int
hashCode()
-
Methods inherited from class com.day.cq.search.facets.extractors.PropertyFacetExtractor
handleNode
-
-
-
-
Constructor Detail
-
PredefinedBucketsFacetExtractor
public PredefinedBucketsFacetExtractor(java.lang.String propertyRelPath)
-
PredefinedBucketsFacetExtractor
public PredefinedBucketsFacetExtractor(java.lang.String propertyRelPath, java.util.Collection<? extends PredefinedBucket> buckets)
-
-
Method Detail
-
addPredefinedBucket
public void addPredefinedBucket(PredefinedBucket bucket)
Adds a predefined bucket to this extractor.- Parameters:
definition
- the bucket definition to add.
-
getFacet
public Facet getFacet()
Description copied from interface:FacetExtractor
Called after the result set was scanned (andFacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the finalFacet
object. Please note that this might be called withoutFacetExtractor.handleNode(Node)
ever being called, if the result was empty.Implementations can use the simple
FacetImpl
implementation of theFacet
interface.- Returns:
- an implementation of the
Facet
interface with all buckets found in the result ornull
if nothing was found in the result
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-