Package studio.mevera.lotus.api.slot
Record Class Slot
java.lang.Object
java.lang.Record
studio.mevera.lotus.api.slot.Slot
- All Implemented Interfaces:
Comparable<Slot>
Position within a menu, identified by its raw inventory index.
Row/column derivation is capacity-relative — see row(Capacity) and column(Capacity).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Slotintintfinal booleanIndicates whether some other object is "equal to" this one.static @NotNull Slotfirst()final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.static @NotNull Slotstatic @NotNull Slotof(int index) intfinal StringtoString()Returns a string representation of this record class.@NotNull Slottranslate(int delta)
-
Constructor Details
-
Slot
public Slot(int index) Creates an instance of aSlotrecord class.- Parameters:
index- the value for theindexrecord component
-
-
Method Details
-
of
-
at
-
first
-
last
-
row
-
column
-
translate
-
compareTo
- Specified by:
compareToin interfaceComparable<Slot>
-
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 with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-