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
public class DateRangeQuery extends AbstractFieldQuery
Represents aQuerytesting a date range.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator
-
-
Field Summary
Fields Modifier and Type Field Description protected AdaptableDate_fromThe lower end of the date range.protected boolean_includeFromTrue to include the lower end, false to exclude it.protected boolean_includeToTrue to include the upper end, false to exclude it.protected AdaptableDate_toThe upper end of the date range.-
Fields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath
-
-
Constructor Summary
Constructors Constructor Description DateRangeQuery(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Build the solr query string representing the Query object.booleanequals(Object obj)inthashCode()-
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath
-
-
-
-
Field Detail
-
_from
protected AdaptableDate _from
The lower end of the date range.
-
_to
protected AdaptableDate _to
The upper end of the date range.
-
_includeFrom
protected boolean _includeFrom
True to include the lower end, false to exclude it.
-
_includeTo
protected boolean _includeTo
True to include the upper end, false to exclude it.
-
-
Constructor Detail
-
DateRangeQuery
public DateRangeQuery(String fieldPath, LocalDate from, LocalDate to)
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, AdaptableDate from, AdaptableDate to)
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 Detail
-
build
public String build() throws QuerySyntaxException
Description copied from interface:QueryBuild 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
public int hashCode()
- Overrides:
hashCodein classAbstractFieldQuery
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractFieldQuery
-
-