Class QueryParams<T extends QueryField>


  • @AlfrescoPublicApi
    public class QueryParams<T extends QueryField>
    extends Object
    Options when listing something.
    Since:
    2.6
    Author:
    Tom Page
    • Constructor Detail

      • QueryParams

        public QueryParams​(List<Pair<T,​Boolean>> sortProps)
        Constructor that takes the sort order.
        Parameters:
        sortProps - A list of fields to sort on, and the direction to sort in.
    • Method Detail

      • withSkipCount

        public QueryParams<T> withSkipCount​(int skipCount)
        Sets the skip count required.
      • withMaxItems

        public QueryParams<T> withMaxItems​(int maxItems)
        Sets the max items count required.
      • withSortProps

        public QueryParams<T> withSortProps​(List<Pair<T,​Boolean>> sortProps)
        Sets the sort properties required.
        Parameters:
        sortProps - A list of pairs of properties and sort directions.
        Returns:
        The updated QueryParams object.
      • setSortProps

        public void setSortProps​(List<Pair<T,​Boolean>> sortProps)
        Sets the sort properties required and validates the list.
        Parameters:
        sortProps - A list of pairs of properties and sort directions.
      • getSortProps

        public List<Pair<T,​Boolean>> getSortProps()
        Get the ordered list of columns to sort on (and their sort direction).
      • getSkipCount

        public int getSkipCount()
        Get the number of items to skip before creating the list.
      • getMaxItems

        public int getMaxItems()
        Get the total number of items to return (assuming enough are available).