Class Pagination

java.lang.Object
hudson.model.AbstractDescribableImpl<Pagination>
io.jenkins.plugins.restlistparam.model.Pagination
All Implemented Interfaces:
Describable<Pagination>, Serializable
Direct Known Subclasses:
ContinuationTokenPagination, LinkHeaderPagination

public abstract class Pagination extends AbstractDescribableImpl<Pagination> implements Serializable
How a parameter follows a paginated REST API: given one fetched page, a strategy tells where the next page is. The fetch loop, the page limit and the origin and loop guards live in RestValueService.
See Also:
  • Field Details

  • Constructor Details

    • Pagination

      public Pagination()
  • Method Details

    • getMaxPages

      public int getMaxPages()
    • setMaxPages

      @DataBoundSetter public void setMaxPages(int maxPages)
    • getEffectiveMaxPages

      public int getEffectiveMaxPages()
      Returns:
      The page limit actually applied: getMaxPages() clamped to 1..100
    • next

      public abstract Optional<Pagination.NextPage> next(Pagination.Page page)
      Finds the next page to request after page.
      Parameters:
      page - The page just fetched
      Returns:
      The next page, or empty when page is the last one
    • incompatibilityWith

      public Optional<String> incompatibilityWith(MimeType mimeType)
      The error that makes this strategy unusable with mimeType at fetch time, if any. Configuration mistakes that can still be fetched (such as an out-of-range page limit) are not errors here.
    • validate

      public FormValidation validate(MimeType mimeType)
      Runs the same checks as the configuration form's field checks, for settings that were never saved.
      Parameters:
      mimeType - The parameter's MIME type
      Returns:
      The first failing check, or FormValidation.ok()
    • checkMaxPages

      public static FormValidation checkMaxPages(String value)