Record Class GuidePage
java.lang.Object
java.lang.Record
ke.ric.api.guide.GuidePage
public record GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission, int totalItems, int windowPage, List<GuideCategory> categories)
extends Record
Immutable fixed content and an optional standard 21-item paginated list.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuidePage(String title, List<GuideEntry> entries) GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items) GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission) GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission, int totalItems, int windowPage) GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission, int totalItems, int windowPage, List<GuideCategory> categories) Creates an instance of aGuidePagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecategoriesrecord component.static GuidePagecategorized(String title, List<GuideEntry> entries, List<GuideCategory> categories) categoryTitle(int pageIndex) static intclampPage(int totalItems, int requested) intdisplayPage(int requested) entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intitemOffset(int pageIndex) items()Returns the value of theitemsrecord component.intintpageSize(int pageIndex) Returns the value of thepermissionrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalItemsrecord component.static GuidePagewindow(String title, List<GuideEntry> entries, List<GuideListEntry> items, int totalItems, int pageIndex) booleanwindowed()intReturns the value of thewindowPagerecord component.
-
Field Details
-
LIST_SLOTS
-
-
Constructor Details
-
GuidePage
public GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission, int totalItems, int windowPage) -
GuidePage
public GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission) -
GuidePage
-
GuidePage
-
GuidePage
public GuidePage(String title, List<GuideEntry> entries, List<GuideListEntry> items, String permission, int totalItems, int windowPage, List<GuideCategory> categories) Creates an instance of aGuidePagerecord class.- Parameters:
title- the value for thetitlerecord componententries- the value for theentriesrecord componentitems- the value for theitemsrecord componentpermission- the value for thepermissionrecord componenttotalItems- the value for thetotalItemsrecord componentwindowPage- the value for thewindowPagerecord componentcategories- the value for thecategoriesrecord component
-
-
Method Details
-
window
public static GuidePage window(String title, List<GuideEntry> entries, List<GuideListEntry> items, int totalItems, int pageIndex) -
windowed
public boolean windowed() -
displayPage
public int displayPage(int requested) -
itemOffset
public int itemOffset(int pageIndex) -
pageSize
public int pageSize(int pageIndex) -
categoryTitle
-
categorized
public static GuidePage categorized(String title, List<GuideEntry> entries, List<GuideCategory> categories) -
clampPage
public static int clampPage(int totalItems, int requested) -
pageCount
public int pageCount() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
totalItems
public int totalItems()Returns the value of thetotalItemsrecord component.- Returns:
- the value of the
totalItemsrecord component
-
windowPage
public int windowPage()Returns the value of thewindowPagerecord component.- Returns:
- the value of the
windowPagerecord component
-
categories
Returns the value of thecategoriesrecord component.- Returns:
- the value of the
categoriesrecord component
-