Class ExtensionQuery
- java.lang.Object
-
- org.xwiki.extension.repository.search.ExtensionQuery
-
- Direct Known Subclasses:
IndexedExtensionQuery
public class ExtensionQuery extends Object
A query to an extension repository.- Since:
- 7.0M2
- Version:
- $Id: 5af22c7e170f583a271af41a812636819409b36c $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExtensionQuery.COMPARISON
The comparison to apply.static class
ExtensionQuery.Filter
A filter to apply on an extension field.static class
ExtensionQuery.ORDER
The order in which extensions should be sorted.static class
ExtensionQuery.SortClause
The sort criteria.
-
Constructor Summary
Constructors Constructor Description ExtensionQuery()
No filtering.ExtensionQuery(String query)
ExtensionQuery(ExtensionQuery query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionQuery
addFilter(String field, Object value, ExtensionQuery.COMPARISON comparison)
ExtensionQuery
addFilters(List<ExtensionQuery.Filter> newFilters)
ExtensionQuery
addSort(String field, ExtensionQuery.ORDER order)
List<ExtensionQuery.Filter>
getFilters()
int
getLimit()
int
getOffset()
String
getQuery()
List<ExtensionQuery.SortClause>
getSortClauses()
ExtensionQuery
setFilters(Collection<ExtensionQuery.Filter> filters)
ExtensionQuery
setLimit(int limit)
ExtensionQuery
setOffset(int offset)
ExtensionQuery
setSortClauses(Collection<ExtensionQuery.SortClause> sortClauses)
-
-
-
Constructor Detail
-
ExtensionQuery
public ExtensionQuery()
No filtering. Usually return everything.
-
ExtensionQuery
public ExtensionQuery(String query)
- Parameters:
query
- the query to execute
-
ExtensionQuery
public ExtensionQuery(ExtensionQuery query)
- Parameters:
query
- the query to duplicate
-
-
Method Detail
-
getQuery
public String getQuery()
- Returns:
- the query statement
-
setLimit
public ExtensionQuery setLimit(int limit)
- Parameters:
limit
- the number of results to return when querying extensions- Returns:
- this query.
-
setOffset
public ExtensionQuery setOffset(int offset)
- Parameters:
offset
- offset of query result to set (skip first "offset" rows).- Returns:
- this query.
-
getFilters
public List<ExtensionQuery.Filter> getFilters()
- Returns:
- the filters
-
setFilters
public ExtensionQuery setFilters(Collection<ExtensionQuery.Filter> filters)
- Parameters:
filters
- the filters- Returns:
- this
-
addFilter
public ExtensionQuery addFilter(String field, Object value, ExtensionQuery.COMPARISON comparison)
- Parameters:
field
- the name of the fieldvalue
- the value to compare tocomparison
- the comparison to apply- Returns:
- this
-
addFilters
public ExtensionQuery addFilters(List<ExtensionQuery.Filter> newFilters)
- Parameters:
newFilters
- the filters to add- Returns:
- this
- Since:
- 8.3RC1
-
getSortClauses
public List<ExtensionQuery.SortClause> getSortClauses()
- Returns:
- the criteria used to sort the result
-
setSortClauses
public ExtensionQuery setSortClauses(Collection<ExtensionQuery.SortClause> sortClauses)
- Parameters:
sortClauses
- the criteria used to sort the result- Returns:
- this
-
addSort
public ExtensionQuery addSort(String field, ExtensionQuery.ORDER order)
- Parameters:
field
- the name of the fieldorder
- the order in which extensions should be sorted- Returns:
- this
-
getLimit
public int getLimit()
- Returns:
- limit limit of result list.
- See Also:
setLimit(int)
-
getOffset
public int getOffset()
- Returns:
- offset offset of query result.
- See Also:
setOffset(int)
-
-