Record Class PaginationManager.PageData

java.lang.Object
java.lang.Record
dev.sympho.bot_utils.PaginationManager.PageData
Record Components:
args - The page arguments.
index - The page index.
pageCount - The total amount of pages available.
content - The page content.
components - The components to attach to the page. Only up to 4 rows as one row is used by the page controls.
Enclosing class:
PaginationManager

public static record PaginationManager.PageData(String args, @org.checkerframework.checker.index.qual.NonNegative int index, @org.checkerframework.checker.index.qual.NonNegative int pageCount, EmbedCreateSpec content, List<LayoutComponent> components) extends Record
The data of a page to be displayed.
Since:
1.0
  • Field Details

    • MAX_ROWS

      public static final int MAX_ROWS
      Maximum number of component rows.
      See Also:
  • Constructor Details

    • PageData

      public PageData(String args, @org.checkerframework.checker.index.qual.NonNegative int index, @org.checkerframework.checker.index.qual.NonNegative int pageCount, EmbedCreateSpec content, List<LayoutComponent> components)
      Creates a new instance.
      Throws:
      IllegalArgumentException - if more than 4 component rows are given.
  • Method Details

    • of

      public static PaginationManager.PageData of(String args, @org.checkerframework.checker.index.qual.NonNegative int index, @org.checkerframework.checker.index.qual.NonNegative int pageCount, EmbedCreateSpec content, List<LayoutComponent> components)
      Creates a new instance.
      Parameters:
      args - The page arguments.
      index - The page index.
      pageCount - The total amount of pages available.
      content - The page content.
      components - The components to attach to the page. Only up to 4 rows as one row is used by the page controls.
      Returns:
      The created instance.
    • of

      public static PaginationManager.PageData of(String args, @org.checkerframework.checker.index.qual.NonNegative int index, @org.checkerframework.checker.index.qual.NonNegative int pageCount, EmbedCreateSpec content)
      Creates a new instance.
      Parameters:
      args - The page arguments.
      index - The page index.
      pageCount - The total amount of pages available.
      content - The page content.
      Returns:
      The created instance.
    • toString

      public final 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
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • args

      public String args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • index

      public @org.checkerframework.checker.index.qual.NonNegative int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • pageCount

      public @org.checkerframework.checker.index.qual.NonNegative int pageCount()
      Returns the value of the pageCount record component.
      Returns:
      the value of the pageCount record component
    • content

      public EmbedCreateSpec content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • components

      public List<LayoutComponent> components()
      Returns the value of the components record component.
      Returns:
      the value of the components record component