Class ResultSet<T extends ResultSetItem>


  • public final class ResultSet<T extends ResultSetItem>
    extends Object
    A result set usually consists of a list of items and additional result set information (e.g. to mark first and last items).

    This class is immutable.

    • Method Detail

      • getItems

        public final List<T> getItems()
        Gets the items.
        Returns:
        The items.
      • getResultSetManagement

        public final ResultSetManagement getResultSetManagement()
        Gets the result set info.
        Returns:
        The result set info.
      • create

        public static <T extends ResultSetItemResultSet<T> create​(ResultSetProvider<T> resultSetProvider,
                                                                    ResultSetManagement resultSetManagement)
        Creates a result set from a result set provider and a result set management.

        If the result set management asks for a limited result set (e.g. starting at a specific index and a maximum size), this method takes care, that the result set provider returns the appropriate results.

        The returned result set contains the limited result set as well as a result set management, which contains the total item count and which can be used by the requester to navigate through the results, e.g. by asking for the previous or next page.

        Type Parameters:
        T - The type of the result set.
        Parameters:
        resultSetProvider - The result set provider.
        resultSetManagement - The result set management.
        Returns:
        The result set.