Package org.ametys.cms.search.query
Class ContentLanguageQuery
- java.lang.Object
-
- org.ametys.cms.search.query.ContentLanguageQuery
-
- All Implemented Interfaces:
Query
public class ContentLanguageQuery extends Object implements Query
Represents aQuery
testing the content language.
-
-
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 private Query.LogicalOperator
_logicalOperator
The logical operator between the values.private Query.Operator
_operator
The operator (can only be EQ or NE).private String[]
_values
The language values to test.
-
Constructor Summary
Constructors Constructor Description ContentLanguageQuery()
Build a ContentLanguageQuery to test if the contentLanguage property exists.ContentLanguageQuery(String value)
Build a ContentLanguageQuery.ContentLanguageQuery(String... values)
Build a ContentLanguageQuery.ContentLanguageQuery(Query.Operator operator, String value)
Build a ContentLanguageQuery.ContentLanguageQuery(Query.Operator operator, String... values)
Build a ContentLanguageQuery.ContentLanguageQuery(Query.Operator operator, Query.LogicalOperator logicalOperator, String... values)
Build a ContentLanguageQuery.
-
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.LogicalOperator
getLogicalOperator()
Get the logical operator.Query.Operator
getOperator()
Get the operator.String[]
getValues()
Get the values.int
hashCode()
-
-
-
Field Detail
-
_operator
private Query.Operator _operator
The operator (can only be EQ or NE).
-
_logicalOperator
private Query.LogicalOperator _logicalOperator
The logical operator between the values.
-
-
Constructor Detail
-
ContentLanguageQuery
public ContentLanguageQuery()
Build a ContentLanguageQuery to test if the contentLanguage property exists.
-
ContentLanguageQuery
public ContentLanguageQuery(String value)
Build a ContentLanguageQuery.- Parameters:
value
- the language equality to test.
-
ContentLanguageQuery
public ContentLanguageQuery(String... values)
Build a ContentLanguageQuery.- Parameters:
values
- the languages to test.
-
ContentLanguageQuery
public ContentLanguageQuery(Query.Operator operator, String value)
Build a ContentLanguageQuery.- Parameters:
operator
- the operator.value
- the language code.
-
ContentLanguageQuery
public ContentLanguageQuery(Query.Operator operator, String... values)
Build a ContentLanguageQuery.- Parameters:
operator
- the operator.values
- the language codes.
-
ContentLanguageQuery
public ContentLanguageQuery(Query.Operator operator, Query.LogicalOperator logicalOperator, String... values)
Build a ContentLanguageQuery.- Parameters:
operator
- the operator.logicalOperator
- the logical operator.values
- the language codes.
-
-
Method Detail
-
getOperator
public Query.Operator getOperator()
Get the operator.- Returns:
- the operator
-
getLogicalOperator
public Query.LogicalOperator getLogicalOperator()
Get the logical operator.- Returns:
- the logical operator.
-
build
public String build() throws QuerySyntaxException
Description copied from interface:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
-