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 Date |
_value
The value to test.
|
static DateFormat |
DATE_FORMAT
The date format.
|
_fieldPath
Constructor and Description |
---|
DateQuery(String fieldPath)
Build a DateQuery testing the existence of the field.
|
DateQuery(String fieldPath,
Date value)
Build a DateQuery.
|
DateQuery(String fieldPath,
Query.Operator op,
Date value)
Build a DateQuery.
|
Modifier and Type | Method and Description |
---|---|
static void |
appendDateValue(StringBuilder query,
Query.Operator operator,
Date 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.
|
Date |
getValue()
Get the value.
|
int |
hashCode() |
getFieldPath
public static final DateFormat DATE_FORMAT
protected Query.Operator _operator
public DateQuery(String fieldPath)
fieldPath
- the field path.public DateQuery(String fieldPath, Date value)
fieldPath
- the field's pathvalue
- the value.public DateQuery(String fieldPath, Query.Operator op, Date value)
fieldPath
- the field's pathop
- the operator.value
- the value.public Query.Operator getOperator()
public String build() throws QuerySyntaxException
Query
QuerySyntaxException
- if the query can't be built because of a syntax error.public int hashCode()
hashCode
in class AbstractFieldQuery
public boolean equals(Object obj)
equals
in class AbstractFieldQuery
public static void appendDateValue(StringBuilder query, Query.Operator operator, Date value)
query
- The string builder containing the query being built.operator
- The query operator.value
- The test value.