Package dev.sympho.bot_utils
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPageData(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. -
Method Summary
Modifier and TypeMethodDescriptionargs()Returns the value of theargsrecord component.Returns the value of thecomponentsrecord component.content()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@org.checkerframework.checker.index.qual.NonNegative intindex()Returns the value of theindexrecord component.static PaginationManager.PageDataof(String args, @org.checkerframework.checker.index.qual.NonNegative int index, @org.checkerframework.checker.index.qual.NonNegative int pageCount, EmbedCreateSpec content) Creates a new instance.static PaginationManager.PageDataof(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.@org.checkerframework.checker.index.qual.NonNegative intReturns the value of thepageCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MAX_ROWS
public static final int MAX_ROWSMaximum 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
args
Returns the value of theargsrecord component.- Returns:
- the value of the
argsrecord component
-
index
public @org.checkerframework.checker.index.qual.NonNegative int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
pageCount
public @org.checkerframework.checker.index.qual.NonNegative int pageCount()Returns the value of thepageCountrecord component.- Returns:
- the value of the
pageCountrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-