Class TokenizedDataPage<T>

java.lang.Object
org.pipservices3.commons.data.TokenizedDataPage<T>

public class TokenizedDataPage<T> extends Object
Data transfer object that is used to pass results of paginated queries. It contains items of retrieved page and optional total number of items.

Most often this object type is used to send responses to paginated queries. Pagination parameters are defined by TokenizedPagingParams object.

The token parameter in the TokenizedPagingParams there means where to start the searxh. The takes parameter sets number of items to return in the page. And the optional total parameter tells to return total number of items in the query.

The data page returns a token that shall be passed to the next search as a starting point.

Remember: not all implementations support the total parameter because its generation may lead to severe performance implications.

See Also:
  • Field Details

    • data

      public List<T> data
      The items of the retrieved page.
    • token

      public String token
      The starting point for the next search.
    • total

      public Integer total
      The total amount of items in a request.
  • Constructor Details

    • TokenizedDataPage

      public TokenizedDataPage(List<T> data, String token, int total)
      Creates a new instance of data page and assigns its values.
      Parameters:
      data - a list of items from the retrieved page.
      token - (optional) a token to define astarting point for the next search.
      total - (optional) a total number of objects in the result.
    • TokenizedDataPage

      public TokenizedDataPage()