Package org.ametys.cms.search.query
Class DateQuery
java.lang.Object
org.ametys.cms.search.query.AbstractFieldQuery
org.ametys.cms.search.query.DateQuery
- All Implemented Interfaces:
Query
Represents a
Query
testing a date field.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator
-
Field Summary
Modifier and TypeFieldDescriptionprotected Query.Operator
The operator.protected AdaptableDate
The value to test.static final DateTimeFormatter
The date formatterFields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath
-
Constructor Summary
ConstructorDescriptionBuild a DateQuery testing the existence of the field.Build a DateQuery.DateQuery
(String fieldPath, Query.Operator op, LocalDate value) Build a DateQuery.DateQuery
(String fieldPath, Query.Operator op, AdaptableDate value) Build a DateQuery.DateQuery
(String fieldPath, AdaptableDate value) Build a DateQuery. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendDateValue
(StringBuilder query, Query.Operator operator, AdaptableDate value) Format and append the given date to a StringBuilder.build()
Build the solr query string representing the Query object.boolean
Get the operator.getValue()
Get the value.int
hashCode()
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath
-
Field Details
-
DATE_FORMATTER
The date formatter -
_operator
The operator. -
_value
The value to test.
-
-
Constructor Details
-
DateQuery
Build a DateQuery testing the existence of the field.- Parameters:
fieldPath
- the field path.
-
DateQuery
Build a DateQuery.- Parameters:
fieldPath
- the field's pathvalue
- the value.
-
DateQuery
Build a DateQuery.- Parameters:
fieldPath
- the field's pathvalue
- the value.
-
DateQuery
Build a DateQuery.- Parameters:
fieldPath
- the field's pathop
- the operator.value
- the value.
-
DateQuery
Build a DateQuery.- Parameters:
fieldPath
- the field's pathop
- the operator.value
- the value.
-
-
Method Details
-
getOperator
Get the operator.- Returns:
- the operator.
-
getValue
Get the value.- Returns:
- the value.
-
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
-
appendDateValue
public static void appendDateValue(StringBuilder query, Query.Operator operator, AdaptableDate value) Format and append the given date to a StringBuilder.- Parameters:
query
- The string builder containing the query being built.operator
- The query operator.value
- The test value.
-