Package eu.xenit.alfred.api.search
Class QueryBuilder
java.lang.Object
eu.xenit.alfred.api.search.QueryBuilder
Object used to build a search query.
-
Constructor Summary
ConstructorsConstructorDescriptionQueryBuilder(QueryBuilder parent, Consumer<SearchSyntaxNode> acceptNode, SearchSyntaxNode result) -
Method Summary
Modifier and TypeMethodDescriptioncreate()end()Closes the current query.not()Starts the building of an not query.Add a property to the query.Add a property to the query.Add a property with a range value to the query.startAnd()Starts the building of an and query.startOr()Starts the building of an and query.
-
Constructor Details
-
QueryBuilder
public QueryBuilder() -
QueryBuilder
public QueryBuilder(QueryBuilder parent, Consumer<SearchSyntaxNode> acceptNode, SearchSyntaxNode result)
-
-
Method Details
-
term
-
create
-
property
Add a property to the query. This is not an exact match.- Parameters:
qname- The qname of the property that should be queried.val- The value of the property that should be queried.- Returns:
- a new QueryBuilder which also contains the new property.
-
property
Add a property to the query.- Parameters:
qname- The qname of the property that should be queried.val- The value of the property that should be queried.exactMatch- Whether the query should be an exact match or not.- Returns:
- a new QueryBuilder which also contains the new property.
-
property
Add a property with a range value to the query.- Parameters:
qname- The qname of the property that should be queried.start- The start of the value of the range on which is searched.end- The end of the value of the range on which is searched.- Returns:
- a new QueryBuilder which also contains the new property on which is search with the given range.
-
startAnd
Starts the building of an and query.- Returns:
- a new QueryBuilder which also contains the and query under construction.
-
end
Closes the current query. For example: In case you started an or query within the current query this closes the or query.- Returns:
- a new QueryBuilder in which the current query is closed.
-
startOr
Starts the building of an and query.- Returns:
- a new QueryBuilder which also contains the and query under construction.
-
not
Starts the building of an not query.- Returns:
- a new QueryBuilder which also contains the and query under construction.
-