public static interface StructureQueryBuilder.BasicConstraintStep<B extends StructureQueryBuilder<B>>
This class allows to specify a basic constraint, either on its own, or as the last step of building a
relational constraint
.
A basic constraint is a simply a constraint on rows; it does not involve its relatives, as relation
constraint does. For examples, see queries q1 and q2 in the class documentation
.
Note that a relational constraint, or even a Boolean combination thereof, can behave as a
basic constraint if taken into parentheses
; this is useful if you are building a relation
constraint, and you need to have a complex constraint in place of basicConstraint
. Examples
of it are queries q9 and q10 in the class documentation
.
Modifier and Type | Method and Description |
---|---|
B |
all()
Matches all rows.
|
B |
constraint(String name,
Iterable<String> arguments) |
B |
constraint(String name,
String... arguments)
Matches rows using a custom constraint specified by its name, supplying it with the specified arguments.
|
B |
empty()
Matches no rows.
|
B |
issueId(long issueId) |
B |
issueIds(long... issueIds) |
B |
issueIds(LongList issueIds) |
B |
issueKey(String issueKey) |
B |
issueKeys(Iterable<String> issueKeys) |
B |
issueKeys(String... issueKeys) |
B |
issues(Iterable<String> issueKeys,
LongList issueIds)
Matches the specified issues.
|
B |
jql(Query query)
Matches issues that satisfy the specified JQL query.
|
B |
leaf()
Matches rows at the bottom level of the hierarchy.
|
B |
query(StructureQuery query)
Matches all rows that match the specified Structure query.
|
B |
root()
Matches rows at the top level of the hierarchy.
|
StructureQueryBuilder.StartStep<StructureQueryBuilder.Sub<B>> |
sub()
This method starts a new constraint, remembering the currently built constraint.
|
B jql(@Nullable Query query)
query
- a JQL query; if null
, matches all issues in the forest.B issueId(long issueId)
B issueIds(@NotNull LongList issueIds)
B issueIds(@NotNull long... issueIds)
B issues(@Nullable Iterable<String> issueKeys, @Nullable LongList issueIds)
If both parameters are null
or both are empty, matches no issues.
B leaf()
B root()
B empty()
Matches no rows.
This basic condition is useful for relational constraints
:
relation.operator.empty()
matches all rows that do not have corresponding relatives.
For example:
B all()
not().empty()
.B constraint(@NotNull String name, @NotNull String... arguments)
Matches rows using a custom constraint specified by its name, supplying it with the specified arguments.
Structure plugin comes bundled with a few constraints, see the list in S-JQL documentation.
Constraints can also be added by other plugins by the means of implementing StructureQueryConstraint
.
See also query q13 in the examples section in the class documentation.
name
- constraint name - should be either a name of the bundled constraint or,
in case of a custom constraint provided via a plugin, correspond to fname
attribute
of <structure-query-constraint>
module in atlassian-plugin.xml
arguments
- constraint arguments. Both the list and all of its elements must not be null
,
otherwise NullPointerException
is thrownNullPointerException
- if name, arguments, or any of the arguments list elements is null
StructureQueryConstraint
B constraint(@NotNull String name, @NotNull Iterable<String> arguments)
constraint(String, String...)
StructureQueryBuilder.StartStep<StructureQueryBuilder.Sub<B>> sub()
This method starts a new constraint, remembering the currently built constraint. When you finish
building the new constraint, call StructureQueryBuilder.Sub.endsub()
, and the new constraint will be attached to
this builder as if it were a basic constraint.
This is a programmatic equivalent of taking an expression into parentheses: this method "opens"
a new pair of parentheses.
There are several cases when you would want to use this method:
class documentation
);
basicConstraint
in a relational constraint
. For examples, see queries
q9 and q10 in the class documentation
.
B query(@NotNull StructureQuery query)
StructureQuery
that have originated from this API will work; any other implementation
of StructureQuery
will not be recognized, and this constraint will be equivalent to
all()
.query
- Structure query obtained either from StructureQueryBuilder
or
StructureQueryParser
.Copyright © 2024 Tempo Software. All Rights Reserved.