Package de.Keyle.MyPet.api.gui
Record Class SlotSection
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.SlotSection
- Record Components:
id- this section's id within its menutype- the registered type handle this section was decoded ascol- the slot's columnrow- the slot's rowitem- fixed appearance, ornullwhen this is a multi-state slotstates- appearance per state name, ornullfor a fixed slotdefaultState- which ofstatesto show first, ornullfor a fixed slotsoundOnClick- played when the slot is clickedhideAtBoundary- whether a page button hides itself at the first or last page
- All Implemented Interfaces:
Section
public record SlotSection(String id, SectionType<SlotSection> type, int col, int row, @Nullable ItemAppearance item, @Nullable Map<String,ItemAppearance> states, @Nullable String defaultState, SoundSpec soundOnClick, boolean hideAtBoundary)
extends Record
implements Section
Single-slot section. Either a fixed appearance (
item non-null) or a
multi-state slot (states non-null with defaultState naming
a key from the map). Exactly one of the two must be set.
hideAtBoundary only matters when this slot is referenced by a
PaginatedListSection as previous-page-section or
next-page-section: when true (default), the button is not rendered
if the list is on the first/last page (no previous/next page to go to).
When false, the button is always rendered (clicking it at the boundary is a
silent no-op).
-
Constructor Summary
ConstructorsConstructorDescriptionSlotSection(String id, SectionType<SlotSection> type, int col, int row, @Nullable ItemAppearance item, @Nullable Map<String, ItemAppearance> states, @Nullable String defaultState, SoundSpec soundOnClick, boolean hideAtBoundary) Rejects a slot that sets neither or both ofitemandstates. -
Method Summary
Modifier and TypeMethodDescriptionintcol()Returns the value of thecolrecord component.@Nullable StringReturns the value of thedefaultStaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehideAtBoundaryrecord component.id()Returns the value of theidrecord component.@Nullable ItemAppearanceitem()Returns the value of theitemrecord component.introw()Returns the value of therowrecord component.Returns the value of thesoundOnClickrecord component.@Nullable Map<String, ItemAppearance> states()Returns the value of thestatesrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
SlotSection
public SlotSection(String id, SectionType<SlotSection> type, int col, int row, @Nullable @Nullable ItemAppearance item, @Nullable @Nullable Map<String, ItemAppearance> states, @Nullable @Nullable String defaultState, SoundSpec soundOnClick, boolean hideAtBoundary) Rejects a slot that sets neither or both ofitemandstates.
-
-
Method Details
-
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 '=='. -
id
Returns the value of theidrecord component. -
type
Returns the value of thetyperecord component. -
col
public int col()Returns the value of thecolrecord component.- Returns:
- the value of the
colrecord component
-
row
public int row()Returns the value of therowrecord component.- Returns:
- the value of the
rowrecord component
-
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
states
Returns the value of thestatesrecord component.- Returns:
- the value of the
statesrecord component
-
defaultState
Returns the value of thedefaultStaterecord component.- Returns:
- the value of the
defaultStaterecord component
-
soundOnClick
Returns the value of thesoundOnClickrecord component.- Returns:
- the value of the
soundOnClickrecord component
-
hideAtBoundary
public boolean hideAtBoundary()Returns the value of thehideAtBoundaryrecord component.- Returns:
- the value of the
hideAtBoundaryrecord component
-