Class Query

java.lang.Object
org.apache.unomi.api.query.Query
All Implemented Interfaces:
Serializable

public class Query extends Object implements Serializable
A query wrapper gathering all elements needed for a potentially complex CXS query: Condition, offset, limit, sorting specification, etc. Created by kevan on 14/05/15.
See Also:
  • Constructor Details

    • Query

      public Query()
      Instantiates a new Query.
  • Method Details

    • getText

      public String getText()
      Retrieves the text to be used in full-text searches, if any.
      Returns:
      the text to be used in full-text searches or null if no full-text search is needed for this Query
    • setText

      public void setText(String text)
      Sets to be used in full-text searches
      Parameters:
      text - the text to be used in full-text searches or null if no full-text search is needed for this Query
    • getOffset

      public int getOffset()
      Retrieves the offset of the first element to be retrieved
      Returns:
      zero or a positive integer specifying the position of the first item to be retrieved in the total ordered collection of matching items
    • setOffset

      public void setOffset(int offset)
      Sets the offset of the first element to be retrieved
      Parameters:
      offset - zero or a positive integer specifying the position of the first item to be retrieved in the total ordered collection of matching items
    • getLimit

      public int getLimit()
      Retrieves the number of elements to retrieve.
      Returns:
      a positive integer specifying how many matching items should be retrieved or -1 if all of them should be retrieved
    • setLimit

      public void setLimit(int limit)
      Sets the number of elements to retrieve.
      Parameters:
      limit - a positive integer specifying how many matching items should be retrieved or -1 if all of them should be retrieved
    • getSortby

      public String getSortby()
      Retrieves the sorting specifications for this Query in String format, if any.
      Returns:
      an optional (null if no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier: asc or desc.
    • setSortby

      public void setSortby(String sortby)
      Sets the String representation of the sorting specifications for this Query if any. See getSortby() method documentation for format.
      Parameters:
      sortby - the String representation of the sorting specifications for this Query or null if no sorting is required
    • getCondition

      public Condition getCondition()
      Retrieves the Condition associated with this Query.
      Returns:
      the Condition associated with this Query
    • setCondition

      public void setCondition(Condition condition)
      Sets the Condition associated with this Query.
      Parameters:
      condition - the Condition associated with this Query
    • isForceRefresh

      public boolean isForceRefresh()
      Determines whether or not an index refresh is needed before performing this Query
      Returns:
      true if an index refresh is needed before performing this Query, false otherwise
    • setForceRefresh

      public void setForceRefresh(boolean forceRefresh)
      Specifies whether or not an index refresh is needed before performing this Query.
      Parameters:
      forceRefresh - true if an index refresh is needed before performing this Query, false otherwise
    • getScrollIdentifier

      public String getScrollIdentifier()
    • setScrollIdentifier

      public void setScrollIdentifier(String scrollIdentifier)
    • getScrollTimeValidity

      public String getScrollTimeValidity()
    • setScrollTimeValidity

      public void setScrollTimeValidity(String scrollTimeValidity)