Class AbstractSearch

    • Field Detail

      • startOffset

        protected final int startOffset
      • limit

        protected final int limit
    • Constructor Detail

      • AbstractSearch

        protected AbstractSearch​(EnumSet<SearchIndex> indexes,
                                 @NonNull SearchQuery query,
                                 SearchSort sort)
        Constructs an abstract representation of a search to be performed. The maximum number of results returned will be a system provided default.
        Parameters:
        indexes - the non-empty, non-null set of indexes which will be searched
        query - the non-null query to perform on the indexes
        sort - how to order the results of the query
      • AbstractSearch

        protected AbstractSearch​(EnumSet<SearchIndex> indexes,
                                 @NonNull SearchQuery query,
                                 SearchSort sort,
                                 int startOffset,
                                 int limit)
        Constructs an abstract representation of a search to be performed.
        Parameters:
        indexes - the indexes which will be searched, non-empty.
        query - the query to perform on the indexes non-null.
        sort - how to order the results of the query
        startOffset - the zero-based offset of the first result to return
        limit - the maximum number of results to return
    • Method Detail

      • getQuery

        public @NonNull SearchQuery getQuery()
        Gets the query component of the search
        Specified by:
        getQuery in interface ISearch
        Returns:
        the non-null search query
      • getSort

        public SearchSort getSort()
        Gets the sort component of the search
        Specified by:
        getSort in interface ISearch
        Returns:
        the search sort
      • getStartOffset

        public int getStartOffset()
        Specified by:
        getStartOffset in interface ISearch
        Returns:
        the start offset (0 based).
      • getLimit

        public int getLimit()
        Specified by:
        getLimit in interface ISearch
        Returns:
        the maximum page size (positive).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object