com.h3c.util

## Class MarkPage<D>

- java.lang.Object
- - com.h3c.util.type.Page<MarkPageRequest<D>,D>
  - - com.h3c.util.MarkPage<D>

- Type Parameters:
    `D` - type of the data.
  All Implemented Interfaces:
    Serializable

      public class MarkPage<D>
      extends Page<MarkPageRequest<D>,D>

  Mark based data page. This is used for paging data on NOSQL databases such as Cassandra. This page extends a generic Page that can be used for all kinds of databases. The Page contains a `MarkPageRequest` holding the marker and the direction to navigate. This scheme is different than paging using Offsets due to the nature of data storage in NOSQL DB.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarkPage(MarkPageRequest<D> pageRequest, List<D> data)` Creates a data page.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> MarkPage<T>` | `convert(Converter<D,T> converter)` Converts a page to a different data type.
    `static <T> MarkPage<T>` | `emptyPage()` Returns the empty page (immutable).
    `MarkPageRequest<D>` | `getNextPageRequest()` Creates a request for the next page.
    `MarkPageRequest<D>` | `getPreviousPageRequest()` Creates a request for the previous page.

    - ### Methods inherited from class com.h3c.util.type.Page

      `getData, getRequest, isEmpty, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MarkPage

          public MarkPage(MarkPageRequest<D> pageRequest,
                  List<D> data)

      Creates a data page.
      Parameters:
        `pageRequest` - request that generated this page.
        `data` - page's data.

  - ### Method Detail

    - #### emptyPage

          public static <T> MarkPage<T> emptyPage()

      Returns the empty page (immutable).
      Returns:
        an empty page.

    - #### convert

          public <T> MarkPage<T> convert(Converter<D,T> converter)

      Converts a page to a different data type.
      Parameters:
        `converter` - converter.
      Returns:
        a page with the new data type.

    - #### getNextPageRequest

          public MarkPageRequest<D> getNextPageRequest()

      Creates a request for the next page.
      Returns:
        a request for the next page if there is a page, `null` otherwise.

    - #### getPreviousPageRequest

          public MarkPageRequest<D> getPreviousPageRequest()

      Creates a request for the previous page.
      Returns:
        a request for the previous page if there is a page, `null` otherwise.

Copyright © 2014. All Rights Reserved.