Package com.appiancorp.common.query
Class GenericFacetOption
- All Implemented Interfaces:
com.appiancorp.common.query.ReadOnlyFacetOption
This class holds the metadata for an individual option for a facet
. The key piece of
metadata of a facet option is the filters that should be applied when that facet is selected. For
example:
- a "Color" facet could have the option "Black" which specifies a single filter:
color = black
- a "Closing Date" facet could have the option "1st Quarter" which specifies the filters:
closingDate >= 2012-01-01
andclosingDate < 2012-04-01
-
Field Summary
Fields inherited from class com.appiancorp.common.query.FacetOption
COUNT_NOT_AVAILABLE, LOCAL_PART, QNAME, XML_ROOT_ELEMENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
setFilters
(List<Filter<Object>> filters) Sets the list of filters to add to a query when this option is selected.Methods inherited from class com.appiancorp.common.query.FacetOption
equalDataCheck, equals, getAppliedOptions, getDataCount, getFiltersReadOnly, getId, getName, hashCode, isApplied, isAppliedPredicate, setApplied, setDataCount, toString
-
Constructor Details
-
GenericFacetOption
Constructs a new facet option. TheisApplied
property is set tofalse
, and thedataCount
property is set toFacetOption.COUNT_NOT_AVAILABLE
.- Parameters:
id
- the id of this optionname
- the name of this optionfilters
- the list of filters to add to a query when this option is selected
-
GenericFacetOption
public GenericFacetOption(String id, String name, List<Filter<Object>> filters, boolean isApplied, int dataCount) Constructs a new facet option.- Parameters:
id
- the id of this optionname
- the name of this optionfilters
- the list of filters to add to a query when this option is selectedisApplied
- whether this option is selected or notdataCount
- the number of objects whose data matches the filters of this option
-
-
Method Details
-
getFilters
- Specified by:
getFilters
in classFacetOption<Object>
- Returns:
- The list of filters to add to a query when this option is selected.
-
setFilters
Description copied from class:FacetOption
Sets the list of filters to add to a query when this option is selected.- Specified by:
setFilters
in classFacetOption<Object>
- Parameters:
filters
- the list of filters
-
getFiltersAsCriteria
- Specified by:
getFiltersAsCriteria
in interfacecom.appiancorp.common.query.ReadOnlyFacetOption
- Specified by:
getFiltersAsCriteria
in classFacetOption<Object>
- Returns:
- This option's filters wrapped in a criteria if needed.
-