|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.jql.builder.JqlOrderByBuilder
@NotThreadSafe public class JqlOrderByBuilder
Used to create OrderBy
clauses to be included in Query
's.
The OrderBy portion of a JQL query is made up of zero of more order clauses. Each clause composes of a field
and either a SortOrder.ASC
or a SortOrder.DESC
sort order.
The order of sorting is from the first search clause in the list to the last. For example
builder.status(SortOrder.DESC).component(SortOrder.ASC).buildOrderBy()
will produce the Order By statement
Order By status DESC component ASC
which will first sort the result by status descending, and then by component
ascending.
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public JqlOrderByBuilder setSorts(Collection<SearchSort> newSorts)
newSorts
- the new sorts to include in the builder, must not be null.
public JqlOrderByBuilder setSorts(OrderBy existingOrderBy)
existingOrderBy
- the template which defines the state the builder will be in once this method returns.
public Query buildQuery()
Query
using the current builder. When endOrderBy()
is not null, this
equates to calling endOrderBy().buildQuery()
. When endOrderBy()
is null, this equates to calling
new QueryImpl(null, buildOrderBy(), null)
.
IllegalStateException
- if it is not possible to build the current query given the state of the builder.public OrderBy buildOrderBy()
OrderBy
that is defined by the state of the builder.
NOTE: Calling this method does not change the state of the builder, there are no limitations on the
number of times this method can be invoked.public JqlQueryBuilder endOrderBy()
JqlQueryBuilder
.public JqlOrderByBuilder clear()
public JqlOrderByBuilder addSortForFieldName(String fieldName, SortOrder order, boolean makePrimarySort)
fieldName
- the field name used to lookup the JQL clause name via SearchHandlerManager.getJqlClauseNames(String)
method.order
- the order, ASC, or DESC.makePrimarySort
- if true this will be added to the beginning of the sorts, otherwise it will be added to
the end.
public JqlOrderByBuilder add(String jqlClauseName, SortOrder order, boolean makePrimarySort)
jqlClauseName
- the JQL clause name to sort by.order
- the order, ASC, or DESC.makePrimarySort
- if true this will be added to the beginning of the sorts, otherwise it will be added to
the end.
public JqlOrderByBuilder add(String jqlClauseName, SortOrder order)
add(String, com.atlassian.query.order.SortOrder, boolean)
with false.
jqlClauseName
- the JQL clause name to sort by.order
- the order, ASC, or DESC.
public JqlOrderByBuilder add(String jqlClauseName)
add(String, com.atlassian.query.order.SortOrder, boolean)
with null and
false.
jqlClauseName
- the JQL clause name to sort by.
public JqlOrderByBuilder priority(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder priority(SortOrder order)
public JqlOrderByBuilder currentEstimate(SortOrder order)
public JqlOrderByBuilder currentEstimate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder originalEstimate(SortOrder order)
public JqlOrderByBuilder originalEstimate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder votes(SortOrder order)
public JqlOrderByBuilder votes(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder watches(SortOrder order)
public JqlOrderByBuilder watches(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder issueKey(SortOrder order)
public JqlOrderByBuilder issueKey(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder issueId(SortOrder order)
public JqlOrderByBuilder issueId(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder project(SortOrder order)
public JqlOrderByBuilder project(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder issueType(SortOrder order)
public JqlOrderByBuilder issueType(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder createdDate(SortOrder order)
public JqlOrderByBuilder createdDate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder dueDate(SortOrder order)
public JqlOrderByBuilder dueDate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder updatedDate(SortOrder order)
public JqlOrderByBuilder updatedDate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder summary(SortOrder order)
public JqlOrderByBuilder summary(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder resolution(SortOrder order)
public JqlOrderByBuilder resolution(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder status(SortOrder order)
public JqlOrderByBuilder status(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder component(SortOrder order)
public JqlOrderByBuilder component(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder affectedVersion(SortOrder order)
public JqlOrderByBuilder affectedVersion(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder fixForVersion(SortOrder order)
public JqlOrderByBuilder fixForVersion(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder description(SortOrder order)
public JqlOrderByBuilder description(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder environment(SortOrder order)
public JqlOrderByBuilder environment(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder resolutionDate(SortOrder order)
public JqlOrderByBuilder resolutionDate(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder reporter(SortOrder order)
public JqlOrderByBuilder reporter(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder assignee(SortOrder order)
public JqlOrderByBuilder assignee(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder workRatio(SortOrder order)
public JqlOrderByBuilder workRatio(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder timeSpent(SortOrder order)
public JqlOrderByBuilder timeSpent(SortOrder order, boolean makePrimarySort)
public JqlOrderByBuilder securityLevel(SortOrder order)
public JqlOrderByBuilder securityLevel(SortOrder order, boolean makePrimarySort)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |