Package de.Keyle.MyPet.api.gui
Record Class MenuInstanceSnapshot
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.MenuInstanceSnapshot
- Record Components:
pageIndices- current page per paginated-list section idslotStates- current state name per multi-state slot section id
public record MenuInstanceSnapshot(Map<String,Integer> pageIndices, Map<String,String> slotStates)
extends Record
Volatile UI state captured when a menu is pushed onto the navigation stack.
Restored when ESC pops back so the user lands on the same page / state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MenuInstanceSnapshotempty()Returns a snapshot holding no page or slot state.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepageIndicesrecord component.Returns the value of theslotStatesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MenuInstanceSnapshot
Defensively copies both maps, treating null as empty.
-
-
Method Details
-
empty
Returns a snapshot holding no page or slot state.- Returns:
- an empty snapshot
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
pageIndices
Returns the value of thepageIndicesrecord component.- Returns:
- the value of the
pageIndicesrecord component
-
slotStates
Returns the value of theslotStatesrecord component.- Returns:
- the value of the
slotStatesrecord component
-