Package org.ametys.cms.search.query
Class DateRangeQuery
java.lang.Object
org.ametys.cms.search.query.AbstractFieldQuery
org.ametys.cms.search.query.DateRangeQuery
- All Implemented Interfaces:
Query
Represents a
Query
testing a date range.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator
-
Field Summary
Modifier and TypeFieldDescriptionprotected AdaptableDate
The lower end of the date range.protected boolean
True to include the lower end, false to exclude it.protected boolean
True to include the upper end, false to exclude it.protected AdaptableDate
The upper end of the date range.Fields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath
-
Constructor Summary
ConstructorDescriptionDateRangeQuery
(String fieldPath, LocalDate from, LocalDate to) Build a date range query.DateRangeQuery
(String fieldPath, LocalDate from, LocalDate to, boolean includeFrom, boolean includeTo) Build a date range query.DateRangeQuery
(String fieldPath, AdaptableDate from, AdaptableDate to) Build a date range query.DateRangeQuery
(String fieldPath, AdaptableDate from, AdaptableDate to, boolean includeFrom, boolean includeTo) Build a date range query. -
Method Summary
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath
-
Field Details
-
_from
The lower end of the date range. -
_to
The upper end of the date range. -
_includeFrom
True to include the lower end, false to exclude it. -
_includeTo
True to include the upper end, false to exclude it.
-
-
Constructor Details
-
DateRangeQuery
Build a date range query.- Parameters:
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.
-
DateRangeQuery
Build a date range query.- Parameters:
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.
-
DateRangeQuery
public DateRangeQuery(String fieldPath, LocalDate from, LocalDate to, boolean includeFrom, boolean includeTo) Build a date range query.- Parameters:
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.includeFrom
- Whether to include the lower end or not.includeTo
- Whether to include the upper end or not.
-
DateRangeQuery
public DateRangeQuery(String fieldPath, AdaptableDate from, AdaptableDate to, boolean includeFrom, boolean includeTo) Build a date range query.- Parameters:
fieldPath
- The field path.from
- The lower end of the range.to
- The upper end of the range.includeFrom
- Whether to include the lower end or not.includeTo
- Whether to include the upper end or not.
-
-
Method Details
-
build
Description copied from interface:Query
Build the solr query string representing the Query object.- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
hashCode
- Overrides:
hashCode
in classAbstractFieldQuery
-
equals
- Overrides:
equals
in classAbstractFieldQuery
-