Package org.ametys.cms.search.query
Class BooleanQuery
- java.lang.Object
-
- org.ametys.cms.search.query.AbstractFieldQuery
-
- org.ametys.cms.search.query.BooleanQuery
-
- All Implemented Interfaces:
Query
public class BooleanQuery extends AbstractFieldQuery
Represents aQuery
testing a boolean field.
-
-
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 Query.Operator
_operator
The operator.protected Boolean
_value
The boolean value to test.-
Fields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath
-
-
Constructor Summary
Constructors Constructor Description BooleanQuery(String fieldPath)
Build a BooleanQuery testing the existence of the field.BooleanQuery(String fieldPath, Boolean value)
Build a BooleanQuery.BooleanQuery(String fieldPath, Query.Operator op, Boolean value)
Build a BooleanQuery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
build()
Build the solr query string representing the Query object.boolean
equals(Object obj)
Query.Operator
getOperator()
Get the operator.boolean
getValue()
Get the value.int
hashCode()
-
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath
-
-
-
-
Field Detail
-
_operator
protected Query.Operator _operator
The operator.
-
-
Constructor Detail
-
BooleanQuery
public BooleanQuery(String fieldPath)
Build a BooleanQuery testing the existence of the field.- Parameters:
fieldPath
- the field's path
-
BooleanQuery
public BooleanQuery(String fieldPath, Boolean value)
Build a BooleanQuery.- Parameters:
fieldPath
- the field's pathvalue
- the value.
-
BooleanQuery
public BooleanQuery(String fieldPath, Query.Operator op, Boolean value)
Build a BooleanQuery.- Parameters:
fieldPath
- the field's pathop
- the operator.value
- the value.
-
-
Method Detail
-
getOperator
public Query.Operator getOperator()
Get the operator.- Returns:
- the operator.
-
getValue
public boolean getValue()
Get the value.- Returns:
- the value.
-
build
public String build() throws QuerySyntaxException
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
public int hashCode()
- Overrides:
hashCode
in classAbstractFieldQuery
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractFieldQuery
-
-