Package com.appiancorp.common.query
Class TypedValueFacetOption
java.lang.Object
com.appiancorp.common.query.FacetOption<TypedValue>
com.appiancorp.common.query.TypedValueFacetOption
- 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
ConstructorDescriptionTypedValueFacetOption
(String id, String name, List<Filter<TypedValue>> filters) Constructs a new facet option.TypedValueFacetOption
(String id, String name, List<Filter<TypedValue>> filters, boolean isApplied, int dataCount) Constructs a new facet option.TypedValueFacetOption
(String name, List<Filter<TypedValue>> filters, boolean isApplied, int dataCount) This is for creating a facet using design time data (a facet that does not yet have an ID since it has not been persisted). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
setFilters
(List<Filter<TypedValue>> 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
-
TypedValueFacetOption
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
-
TypedValueFacetOption
public TypedValueFacetOption(String id, String name, List<Filter<TypedValue>> 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
-
TypedValueFacetOption
public TypedValueFacetOption(String name, List<Filter<TypedValue>> filters, boolean isApplied, int dataCount) This is for creating a facet using design time data (a facet that does not yet have an ID since it has not been persisted). This is necessary to show designers the performance of their record types using changes they have not yet saved.- Parameters:
name
- 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<TypedValue>
- 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<TypedValue>
- Parameters:
filters
- the list of filters
-
getFiltersAsCriteria
- Specified by:
getFiltersAsCriteria
in interfacecom.appiancorp.common.query.ReadOnlyFacetOption
- Specified by:
getFiltersAsCriteria
in classFacetOption<TypedValue>
- Returns:
- This option's filters wrapped in a criteria if needed.
-