Class QueryBuilder

java.lang.Object
eu.xenit.alfred.api.search.QueryBuilder

public class QueryBuilder extends Object
Object used to build a search query.
  • Constructor Details

  • Method Details

    • term

      public QueryBuilder term(String name, String val)
    • create

      public SearchSyntaxNode create()
    • property

      public QueryBuilder property(String qname, String val)
      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

      public QueryBuilder property(String qname, String val, boolean exactMatch)
      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

      public QueryBuilder property(String qname, String start, String end)
      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

      public QueryBuilder startAnd()
      Starts the building of an and query.
      Returns:
      a new QueryBuilder which also contains the and query under construction.
    • end

      public QueryBuilder 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

      public QueryBuilder startOr()
      Starts the building of an and query.
      Returns:
      a new QueryBuilder which also contains the and query under construction.
    • not

      public QueryBuilder not()
      Starts the building of an not query.
      Returns:
      a new QueryBuilder which also contains the and query under construction.