Package de.Keyle.MyPet.api.gui
Record Class MenuId<C>
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.MenuId<C>
- Type Parameters:
C- the context type this menu is opened with- Record Components:
id- the JSON file basename identifying the menucontextType- the context class, used to type-check callers
Typed identity of a registered menu. `id` is the JSON file basename (e.g. "pet-selection");
`contextType` lets
GuiService.openMenu(org.bukkit.entity.Player, de.Keyle.MyPet.api.gui.MenuId<C>, C) type-check the caller's context.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontextTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static <C> MenuId<C> Creates a menu id.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MenuId
Creates an instance of aMenuIdrecord class.- Parameters:
id- the value for theidrecord componentcontextType- the value for thecontextTyperecord component
-
-
Method Details
-
of
Creates a menu id.- Type Parameters:
C- the context type this menu is opened with- Parameters:
id- the JSON file basename identifying the menutype- the context class, used to type-check callers- Returns:
- the new menu id
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
contextType
Returns the value of thecontextTyperecord component.- Returns:
- the value of the
contextTyperecord component
-