public final class BooleanQueryFactory extends Object
SearchQueryParser
operation,
providing a mutable version of the BooleanQuery
.Constructor and Description |
---|
BooleanQueryFactory()
Constructs an empty
BooleanQueryFactory . |
BooleanQueryFactory(Set<SearchQuery> must,
Set<SearchQuery> should,
Set<SearchQuery> mustNot)
Constructs a
BooleanQueryFactory with the specified
SearchQueries as initial values. |
Modifier and Type | Method and Description |
---|---|
void |
addMust(BooleanQueryFactory factory)
Adds the specified
BooleanQueryFactory to the "must match"
criteria after calling toBooleanQuery() on it. |
void |
addMust(Collection<? extends SearchQuery> queries)
Adds the specified
Collection<SearchQuery> to the "must match"
criteria. |
void |
addMust(SearchQuery query)
Adds the specified
SearchQuery to the "must match" criteria. |
void |
addMustNot(BooleanQueryFactory factory)
Adds the specified
BooleanQueryFactory to the "must not match"
criteria after calling toBooleanQuery() on it. |
void |
addMustNot(Collection<? extends SearchQuery> queries)
Adds the specified
Collection<SearchQuery> to the "must not
match" criteria. |
void |
addMustNot(SearchQuery query)
Adds the specified
SearchQuery to the "must not match" criteria. |
void |
addShould(BooleanQueryFactory factory)
Adds the specified
BooleanQueryFactory to the "should match"
criteria after calling toBooleanQuery() on it. |
void |
addShould(Collection<? extends SearchQuery> queries)
Adds the specified
Collection<SearchQuery> to the "should match"
criteria. |
void |
addShould(SearchQuery query)
Adds the specified
SearchQuery to the "should match" criteria. |
boolean |
isEmpty()
Returns true if the current
BooleanQueryFactory is empty; that
is, if no SearchQueries have been added to it. |
void |
merge(BooleanQueryFactory result)
Merges the specified
BooleanQueryFactory with the current one. |
BooleanQuery |
toBooleanQuery()
Returns a
BooleanQuery instance using the current state of this
BooleanQueryFactory . |
public BooleanQueryFactory()
BooleanQueryFactory
.public BooleanQueryFactory(Set<SearchQuery> must, Set<SearchQuery> should, Set<SearchQuery> mustNot)
BooleanQueryFactory
with the specified
SearchQueries
as initial values.must
- queries that must matchshould
- queries that should matchmustNot
- queries that must not matchpublic BooleanQuery toBooleanQuery()
BooleanQuery
instance using the current state of this
BooleanQueryFactory
.BooleanQuery
instance reflecting the current statepublic void addMust(SearchQuery query)
SearchQuery
to the "must match" criteria.query
- the SearchQuery
to addpublic void addMust(Collection<? extends SearchQuery> queries)
Collection<SearchQuery>
to the "must match"
criteria.queries
- the SearchQueries
to addpublic void addMust(BooleanQueryFactory factory)
BooleanQueryFactory
to the "must match"
criteria after calling toBooleanQuery()
on it. Empty or null
factories are silently ignored.factory
- the BooleanQueryFactory
to addpublic void addShould(SearchQuery query)
SearchQuery
to the "should match" criteria.query
- the SearchQuery
to addpublic void addShould(Collection<? extends SearchQuery> queries)
Collection<SearchQuery>
to the "should match"
criteria.queries
- the SearchQueries
to addpublic void addShould(BooleanQueryFactory factory)
BooleanQueryFactory
to the "should match"
criteria after calling toBooleanQuery()
on it. Empty or null
factories are silently ignored.factory
- the BooleanQueryFactory
to addpublic void addMustNot(SearchQuery query)
SearchQuery
to the "must not match" criteria.query
- the SearchQuery
to addpublic void addMustNot(Collection<? extends SearchQuery> queries)
Collection<SearchQuery>
to the "must not
match" criteria.queries
- the SearchQueries
to addpublic void addMustNot(BooleanQueryFactory factory)
BooleanQueryFactory
to the "must not match"
criteria after calling toBooleanQuery()
on it. Empty or null
factories are silently ignored.factory
- the BooleanQueryFactory
to addpublic void merge(BooleanQueryFactory result)
BooleanQueryFactory
with the current one.result
- the BooleanQueryFactory
to mergeIllegalArgumentException
- if result is nullpublic boolean isEmpty()
BooleanQueryFactory
is empty; that
is, if no SearchQueries
have been added to it.BooleanQueryFactory
is empty.Copyright © 2003–2021 Atlassian. All rights reserved.