Class ListResult<T>

    • Constructor Detail

      • ListResult

        protected ListResult()
    • Method Detail

      • init

        public void init​(UriInfo uriInfo,
                         List<T> items,
                         Integer totalCount,
                         Integer maxResults,
                         Integer startAt)
        Initializes all fields of this list result based on the given information.
        Parameters:
        uriInfo - information about the current requested URL.
        items - a list containing the objects that are part of the result.
        totalCount - the total number of existing objects (including objects not included in the current pagination), or null if it is unknown.
        maxResults - the maximum number of results per pagination that was used when generating the data, or null if there is no pagination.
        startAt - the first index (zero-based) of the objects in the current pagination, or null if there is no pagination.
        Since:
        8.0.0
      • getMaxResults

        public Integer getMaxResults()
        Returns the maximum number of results requested to be returned in this ListResult.
        Returns:
        the maximum number of results requested to be returned, or null if there was no maximum number specified.
        Since:
        8.0.0
      • setMaxResults

        public void setMaxResults​(Integer maxResults)
        Sets the maximum number of results requested to be returned in this ListResult.
        Parameters:
        maxResults - the maximum number of results requested to be returned, or null if there is no maximum number specified.
        Since:
        8.0.0
      • getStartAt

        public Integer getStartAt()
        Returns the index of the first result being returned in the current ListResult.
        Returns:
        the index zero-based, or null if it was not specified.
        Since:
        8.0.0
      • setStartAt

        public void setStartAt​(Integer startAt)
        Sets the index of the first result being returned in the current ListResult.
        Parameters:
        startAt - the index zero-based, or null if it was not specified.
        Since:
        8.0.0
      • getTotalCount

        public Integer getTotalCount()
        Returns the total number of items that exist, although not all of them may be returned in this ListResult.
        Returns:
        the total number of items, or null if unknown.
        Since:
        8.0.0
      • setTotalCount

        public void setTotalCount​(Integer totalCount)
        Sets the total number of items that exist, although not all of them may be returned in this ListResult.
        Parameters:
        totalCount - the total number of items, or null if unknown.
        Since:
        8.0.0
      • getFirstUrl

        public String getFirstUrl()
        Returns the URL the corresponds to the first page of this list.
        Returns:
        the URL the corresponds to the first page of this list.
        Since:
        8.0.0
      • setFirstUrl

        public void setFirstUrl​(String firstUrl)
        Sets the URL the corresponds to the first page of this list.
        Parameters:
        firstUrl - the URL the corresponds to the first page of this list.
        Since:
        8.0.0
      • getNextUrl

        public String getNextUrl()
        Returns the URL the corresponds to the next page of this list.
        Returns:
        the URL the corresponds to the next page of this list.
        Since:
        8.0.0
      • setNextUrl

        public void setNextUrl​(String nextUrl)
        Sets the URL the corresponds to the next page of this list.
        Parameters:
        nextUrl - the URL the corresponds to the next page of this list.
        Since:
        8.0.0
      • getPreviousUrl

        public String getPreviousUrl()
        Returns the URL the corresponds to the previous page of this list.
        Returns:
        the URL the corresponds to the previous page of this list.
        Since:
        8.0.0
      • setPreviousUrl

        public void setPreviousUrl​(String previousUrl)
        Sets the URL the corresponds to the previous page of this list.
        Parameters:
        previousUrl - the URL the corresponds to the previous page of this list.
        Since:
        8.0.0
      • getLastUrl

        public String getLastUrl()
        Returns the URL the corresponds to the last page of this list.
        Returns:
        the URL the corresponds to the last page of this list.
        Since:
        8.0.0
      • setLastUrl

        public void setLastUrl​(String lastUrl)
        Sets the URL the corresponds to the last page of this list.
        Parameters:
        lastUrl - the URL the corresponds to the last page of this list.
        Since:
        8.0.0
      • getItems

        public List<T> getItems()
        Returns the backing list object for this result list.
        Returns:
        the backing list object for this result list.
        Since:
        8.0.0
      • setItems

        public void setItems​(List<T> items)
        Sets the backing list object for this result list.
        Parameters:
        items - the backing list object for this result list.
        Since:
        8.0.0
      • createFirstUrl

        protected String createFirstUrl​(UriInfo uriInfo)
        Method called by init(UriInfo, List, Integer, Integer, Integer) for generating the URL that corresponds to the first page of the result.

        This method can be overridden as a way to alter the generation of the first URL without stopping to use the init method.

        Parameters:
        uriInfo - information about the requested URI.
        Returns:
        the URL the corresponds to the page of this list, or null if there is no first page.
        Since:
        8.0.0
      • createNextUrl

        protected String createNextUrl​(UriInfo uriInfo)
        Method called by init(UriInfo, List, Integer, Integer, Integer) for generating the URL that corresponds to the next page of the result.

        This method can be overridden as a way to alter the generation of the next URL without stopping to use the init method.

        Parameters:
        uriInfo - information about the requested URI.
        Returns:
        the URL the corresponds to the page of this list, or null if there is no next page.
        Since:
        8.0.0
      • createPreviousUrl

        protected String createPreviousUrl​(UriInfo uriInfo)
        Method called by init(UriInfo, List, Integer, Integer, Integer) for generating the URL that corresponds to the previous page of the result.

        This method can be overridden as a way to alter the generation of the previous URL without stopping to use the init method.

        Parameters:
        uriInfo - information about the requested URI.
        Returns:
        the URL the corresponds to the page of this list, or null if there is no previous page.
        Since:
        8.0.0
      • createLastUrl

        protected String createLastUrl​(UriInfo uriInfo)
        Method called by init(UriInfo, List, Integer, Integer, Integer) for generating the URL that corresponds to the last page of the result.

        This method can be overridden as a way to alter the generation of the last URL without stopping to use the init method.

        Parameters:
        uriInfo - information about the requested URI.
        Returns:
        the URL the corresponds to the page of this list, or null if there is no last page.
        Since:
        8.0.0