T
- type of the resourceV
- type of the valuepublic final class RangeTermFacetSearchModel<T,V extends Comparable<? super V>> extends Base
Modifier and Type | Field and Description |
---|---|
protected String |
alias |
protected Boolean |
isCountingProducts |
protected SearchModel<T> |
searchModel |
protected Function<V,String> |
typeSerializer |
Modifier and Type | Method and Description |
---|---|
RangeFacetExpression<T> |
allRanges()
Generates an expression to obtain the facet of the attribute for any range.
|
TermFacetExpression<T> |
allTerms()
Generates an expression to obtain the facets of the attribute for all values.
|
String |
getAlias()
The alias related to the facet.
|
SearchModel<T> |
getSearchModel()
The search model for the facet.
|
Boolean |
isCountingProducts()
Whether the facet is counting products.
|
static <T,V extends Comparable<? super V>> |
of(String attributePath,
Function<V,String> typeSerializer)
Creates an instance of the search model to generate range and term facet expressions.
|
RangeFacetExpression<T> |
onlyGreaterThanOrEqualTo(V value)
Generates an expression to obtain the facet of the attribute for only values greater than or equal to the given value.
|
RangeFacetExpression<T> |
onlyLessThan(V value)
Generates an expression to obtain the facet of the attribute for only values less than the given value.
|
RangeFacetExpression<T> |
onlyRange(FacetRange<V> range)
Generates an expression to obtain the facet of the attribute for only the given range.
|
RangeFacetExpression<T> |
onlyRange(Iterable<FacetRange<V>> facetRanges)
Generates an expression to obtain the facet of the attribute for only the given ranges.
|
RangeFacetExpression<T> |
onlyRange(V lowerEndpoint,
V upperEndpoint)
Generates an expression to obtain the facet of the attribute for only the given range.
|
RangeFacetExpression<T> |
onlyRangeAsString(FacetRange<String> range)
Generates an expression to obtain the facet of the attribute for only the given range.
|
RangeFacetExpression<T> |
onlyRangeAsString(Iterable<FacetRange<String>> ranges)
Generates an expression to obtain the facet of the attribute for only the given ranges.
|
FilteredFacetExpression<T> |
onlyTerm(Iterable<V> values)
Generates an expression to obtain the facets of the attribute for only the given values.
|
FilteredFacetExpression<T> |
onlyTerm(V value)
Generates an expression to obtain the facet of the attribute for only the given value.
|
FilteredFacetExpression<T> |
onlyTermAsString(Iterable<String> values)
Generates an expression to obtain the facets of the attribute for only the given values.
|
RangeTermFacetSearchModel<T,V> |
withAlias(String alias)
Allows to set an alias to identify the facet.
|
RangeTermFacetSearchModel<T,V> |
withCountingProducts(Boolean isCountingProducts)
Allows to enable/disable the counting of products.
|
protected final SearchModel<T> searchModel
protected final Boolean isCountingProducts
public RangeTermFacetSearchModel<T,V> withAlias(String alias)
alias
- the identifier to use for the facetpublic RangeTermFacetSearchModel<T,V> withCountingProducts(Boolean isCountingProducts)
isCountingProducts
- whether to count products or notpublic TermFacetExpression<T> allTerms()
allTerms
in interface FacetSearchModel<T,V extends Comparable<? super V>>
public RangeFacetExpression<T> allRanges()
public FilteredFacetExpression<T> onlyTerm(V value)
onlyTerm
in interface FacetSearchModel<T,V extends Comparable<? super V>>
value
- the value from which to obtain the facetpublic FilteredFacetExpression<T> onlyTerm(Iterable<V> values)
onlyTerm
in interface FacetSearchModel<T,V extends Comparable<? super V>>
values
- the values from which to obtain the facetspublic RangeFacetExpression<T> onlyRange(FacetRange<V> range)
range
- the range of values to be present in the facetpublic RangeFacetExpression<T> onlyRange(Iterable<FacetRange<V>> facetRanges)
facetRanges
- the ranges of values to be present in the facetpublic RangeFacetExpression<T> onlyRange(V lowerEndpoint, V upperEndpoint)
lowerEndpoint
- the lower endpoint of the range of values to be present in the facet, inclusiveupperEndpoint
- the upper endpoint of the range of values to be present in the facet, inclusivepublic RangeFacetExpression<T> onlyGreaterThanOrEqualTo(V value)
value
- the lower endpoint of the range [v, +∞)public RangeFacetExpression<T> onlyLessThan(V value)
value
- the upper endpoint of the range (-∞, v)public static <T,V extends Comparable<? super V>> RangeTermFacetSearchModel<T,V> of(String attributePath, Function<V,String> typeSerializer)
T
- type of the resourceV
- type of the valueattributePath
- the path of the attribute as expected by Composable Commerce (e.g. "variants.attributes.color.key")typeSerializer
- the function to convert the provided value to a string accepted by Composable Commercepublic RangeFacetExpression<T> onlyRangeAsString(FacetRange<String> range)
range
- the range of values (as string) to be present in the facetpublic RangeFacetExpression<T> onlyRangeAsString(Iterable<FacetRange<String>> ranges)
ranges
- the ranges of values (as string) to be present in the facet@Nullable public String getAlias()
getAlias
in interface FacetSearchModel<T,V>
public Boolean isCountingProducts()
isCountingProducts
in interface FacetSearchModel<T,V>
public SearchModel<T> getSearchModel()
FacetSearchModel
getSearchModel
in interface FacetSearchModel<T,V>
public FilteredFacetExpression<T> onlyTermAsString(Iterable<String> values)
onlyTermAsString
in interface FacetSearchModel<T,V>
values
- the values from which to obtain the facets