Class QueryFilter

Direct Known Subclasses:
LogEventFilter, UserFilter

public class QueryFilter extends FieldsFilter
Class used to filter the results received when calling endpoints that accept a Query.

This class is not thread-safe.

See Also:
  • Field Details

  • Constructor Details

    • QueryFilter

      public QueryFilter()
  • Method Details

    • withQuery

      public QueryFilter withQuery(String query)
      Filter by a query
      Parameters:
      query - the query expression to use
      Returns:
      this filter instance
    • withTotals

      public QueryFilter withTotals(boolean includeTotals)
      Include the query summary
      Parameters:
      includeTotals - whether to include or not the query summary.
      Returns:
      this filter instance
    • withSort

      public QueryFilter withSort(String sort)
      Sort the query
      Parameters:
      sort - the field to use for sorting. Use 'field:order' where order is 1 for ascending and -1 for descending.
      Returns:
      this filter instance
    • withPage

      public QueryFilter withPage(int pageNumber, int amountPerPage)
      Filter by page
      Parameters:
      pageNumber - the page number to retrieve.
      amountPerPage - the amount of items per page to retrieve.
      Returns:
      this filter instance
    • withFields

      public QueryFilter withFields(String fields, boolean includeFields)
      Description copied from class: FieldsFilter
      Only retrieve certain fields from the item.
      Overrides:
      withFields in class FieldsFilter
      Parameters:
      fields - a list of comma separated fields to retrieve.
      includeFields - whether to include or exclude in the response the fields that were given.
      Returns:
      this filter instance