Record Class PageInfo

java.lang.Object
java.lang.Record
org.patternfly.component.pagination.PageInfo

public record PageInfo(int page, int pageSize, int total) extends Record
Immutable pagination state: current page (1-based), page size, and total item count.
  • Field Details

  • Constructor Details

    • PageInfo

      public PageInfo(int page, int pageSize, int total)
      Creates an instance of a PageInfo record class.
      Parameters:
      page - the value for the page record component
      pageSize - the value for the pageSize record component
      total - the value for the total record component
  • Method Details

    • noItems

      public static PageInfo noItems()
    • indeterminate

      public static PageInfo indeterminate()
    • indeterminate

      public static PageInfo indeterminate(int pageSize)
    • of

      public static PageInfo of(int total)
    • of

      public static PageInfo of(int pageSize, int total)
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • pages

      public int pages()
    • from

      public int from()
    • to

      public int to()
    • isIndeterminate

      public boolean isIndeterminate()
    • isFirstPage

      public boolean isFirstPage()
    • isLastPage

      public boolean isLastPage()
    • hasPreviousPage

      public boolean hasPreviousPage()
    • hasNextPage

      public boolean hasNextPage()
    • firstPage

      public PageInfo firstPage()
    • previousPage

      public PageInfo previousPage()
    • nextPage

      public PageInfo nextPage()
    • lastPage

      public PageInfo lastPage()
    • withPage

      public PageInfo withPage(int page)
    • withPageSize

      public PageInfo withPageSize(int pageSize)
    • withTotal

      public PageInfo withTotal(int total)
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • page

      public int page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • pageSize

      public int pageSize()
      Returns the value of the pageSize record component.
      Returns:
      the value of the pageSize record component
    • total

      public int total()
      Returns the value of the total record component.
      Returns:
      the value of the total record component