public class DateQuery extends AbstractFieldQuery
Query testing a date field.Query.LogicalOperator, Query.Operator| Modifier and Type | Field and Description |
|---|---|
protected Query.Operator |
_operator
The operator.
|
protected AdaptableDate |
_value
The value to test.
|
static DateTimeFormatter |
DATE_FORMATTER
The date formatter
|
_fieldPath| Constructor and Description |
|---|
DateQuery(String fieldPath)
Build a DateQuery testing the existence of the field.
|
DateQuery(String fieldPath,
AdaptableDate value)
Build a DateQuery.
|
DateQuery(String fieldPath,
LocalDate value)
Build a DateQuery.
|
DateQuery(String fieldPath,
Query.Operator op,
AdaptableDate value)
Build a DateQuery.
|
DateQuery(String fieldPath,
Query.Operator op,
LocalDate value)
Build a DateQuery.
|
| Modifier and Type | Method and Description |
|---|---|
private static String |
_format(AdaptableDate value,
Query.Operator operator) |
static void |
appendDateValue(StringBuilder query,
Query.Operator operator,
AdaptableDate value)
Format and append the given date to a StringBuilder.
|
String |
build()
Build the solr query string representing the Query object.
|
boolean |
equals(Object obj) |
Query.Operator |
getOperator()
Get the operator.
|
AdaptableDate |
getValue()
Get the value.
|
int |
hashCode() |
getFieldPathpublic static final DateTimeFormatter DATE_FORMATTER
protected Query.Operator _operator
protected AdaptableDate _value
public DateQuery(String fieldPath)
fieldPath - the field path.public DateQuery(String fieldPath, LocalDate value)
fieldPath - the field's pathvalue - the value.public DateQuery(String fieldPath, AdaptableDate value)
fieldPath - the field's pathvalue - the value.public DateQuery(String fieldPath, Query.Operator op, LocalDate value)
fieldPath - the field's pathop - the operator.value - the value.public DateQuery(String fieldPath, Query.Operator op, AdaptableDate value)
fieldPath - the field's pathop - the operator.value - the value.public Query.Operator getOperator()
public AdaptableDate getValue()
public String build() throws QuerySyntaxException
QueryQuerySyntaxException - if the query can't be built because of a syntax error.public int hashCode()
hashCode in class AbstractFieldQuerypublic boolean equals(Object obj)
equals in class AbstractFieldQuerypublic static void appendDateValue(StringBuilder query, Query.Operator operator, AdaptableDate value)
query - The string builder containing the query being built.operator - The query operator.value - The test value.private static String _format(AdaptableDate value, Query.Operator operator)