com.atlassian.confluence.search.v2.query
Class AndQuery

java.lang.Object
  extended by com.atlassian.confluence.search.v2.query.AndQuery
All Implemented Interfaces:
SearchQuery

public class AndQuery
extends java.lang.Object
implements SearchQuery

Boolean query that applies logical AND to all its sub-queries.


Constructor Summary
AndQuery(java.util.List subqueries)
          Construct a query that is the logical AND of a list of sub-queries.
 
Method Summary
static SearchQuery composeQuery(java.util.List subqueries)
          Return a query that "ANDs" together a list of queries.
static SearchQuery composeQuery(SearchQuery searchQueryOne, SearchQuery searchQueryTwo)
          Build an AND query from exactly two sub-queries.
 java.lang.String getKey()
           
 java.util.List getParameters()
          The parameters of an AND query will all be SearchQuery instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndQuery

public AndQuery(java.util.List subqueries)
Construct a query that is the logical AND of a list of sub-queries.

Parameters:
subqueries - the subqueries to AND
Method Detail

composeQuery

public static SearchQuery composeQuery(java.util.List subqueries)
Return a query that "ANDs" together a list of queries. If the list contains no entries then an AllQuery is installed. If it contains only a single entry, then that entry is returned. Otherwise an AndQuery combining the full list is returned.

Parameters:
subqueries - a list of SearchQuerys to combine. Must have size >= 1.
Returns:
a SearchQuery combining the subqueries.
Throws:
java.lang.IllegalArgumentException - if the list of subqueries is empty.

composeQuery

public static SearchQuery composeQuery(SearchQuery searchQueryOne,
                                       SearchQuery searchQueryTwo)
Build an AND query from exactly two sub-queries.

Parameters:
searchQueryOne - the first sub-query
searchQueryTwo - the second sub-query
Returns:
the logical AND of the two provided queries

getKey

public java.lang.String getKey()
Specified by:
getKey in interface SearchQuery
See Also:
SearchQuery.getKey()

getParameters

public java.util.List getParameters()
The parameters of an AND query will all be SearchQuery instances.

Specified by:
getParameters in interface SearchQuery
Returns:
Strings or SearchQuerys.
See Also:
SearchQuery.getParameters()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.