Package net.minestom.server.dialog
Record Class DialogBody.Item
java.lang.Object
java.lang.Record
net.minestom.server.dialog.DialogBody.Item
- All Implemented Interfaces:
DialogBody
- Enclosing interface:
DialogBody
public static record DialogBody.Item(@NotNull ItemStack itemStack, @Nullable DialogBody.PlainMessage description, boolean showDecoration, boolean showTooltip, int width, int height)
extends Record
implements DialogBody
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.dialog.DialogBody
DialogBody.Item, DialogBody.PlainMessage -
Field Summary
FieldsFields inherited from interface net.minestom.server.dialog.DialogBody
REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionItem(@NotNull ItemStack itemStack, @Nullable DialogBody.PlainMessage description, boolean showDecoration, boolean showTooltip, int width, int height) Creates an instance of aItemrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StructCodec<? extends DialogBody> codec()@Nullable DialogBody.PlainMessageReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.@NotNull ItemStackReturns the value of theitemStackrecord component.booleanReturns the value of theshowDecorationrecord component.booleanReturns the value of theshowTooltiprecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Item
public Item(@NotNull @NotNull ItemStack itemStack, @Nullable @Nullable DialogBody.PlainMessage description, boolean showDecoration, boolean showTooltip, int width, int height) Creates an instance of aItemrecord class.- Parameters:
itemStack- the value for theitemStackrecord componentdescription- the value for thedescriptionrecord componentshowDecoration- the value for theshowDecorationrecord componentshowTooltip- the value for theshowTooltiprecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceDialogBody
-
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 '=='. -
itemStack
Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
showDecoration
public boolean showDecoration()Returns the value of theshowDecorationrecord component.- Returns:
- the value of the
showDecorationrecord component
-
showTooltip
public boolean showTooltip()Returns the value of theshowTooltiprecord component.- Returns:
- the value of the
showTooltiprecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-