Package studio.mevera.lotus.api.button
Record Class ClickableButton
java.lang.Object
java.lang.Record
studio.mevera.lotus.api.button.ClickableButton
- All Implemented Interfaces:
Button
public record ClickableButton(@NotNull org.bukkit.inventory.ItemStack item, @NotNull ClickAction action, @NotNull DataRegistry data)
extends Record
implements Button
-
Constructor Summary
ConstructorsConstructorDescriptionClickableButton(@NotNull org.bukkit.inventory.ItemStack item, @NotNull ClickAction action, @NotNull DataRegistry data) Creates an instance of aClickableButtonrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull ClickActionaction()Returns the value of theactionrecord component.@NotNull DataRegistrydata()Returns the value of thedatarecord component.voiddispatch(@NotNull MenuView<?, ?> view, @NotNull org.bukkit.event.inventory.InventoryClickEvent event) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull org.bukkit.inventory.ItemStackitem()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.@NotNull ClickableButtonwithAction(@NotNull ClickAction action) @NotNull ClickableButtonwithItem(@NotNull org.bukkit.inventory.ItemStack item)
-
Constructor Details
-
ClickableButton
public ClickableButton(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull ClickAction action, @NotNull @NotNull DataRegistry data) Creates an instance of aClickableButtonrecord class.- Parameters:
item- the value for theitemrecord componentaction- the value for theactionrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
withItem
@NotNull public @NotNull ClickableButton withItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item) -
withAction
-
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). -
item
@NotNull public @NotNull org.bukkit.inventory.ItemStack item()Returns the value of theitemrecord component. -
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
data
Returns the value of thedatarecord component.
-