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 aItem
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StructCodec
<? extends DialogBody> codec()
@Nullable DialogBody.PlainMessage
Returns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
height()
Returns the value of theheight
record component.@NotNull ItemStack
Returns the value of theitemStack
record component.boolean
Returns the value of theshowDecoration
record component.boolean
Returns the value of theshowTooltip
record component.final String
toString()
Returns a string representation of this record class.int
width()
Returns the value of thewidth
record 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 aItem
record class.- Parameters:
itemStack
- the value for theitemStack
record componentdescription
- the value for thedescription
record componentshowDecoration
- the value for theshowDecoration
record componentshowTooltip
- the value for theshowTooltip
record componentwidth
- the value for thewidth
record componentheight
- the value for theheight
record component
-
-
Method Details
-
codec
- Specified by:
codec
in 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 theitemStack
record component.- Returns:
- the value of the
itemStack
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
showDecoration
public boolean showDecoration()Returns the value of theshowDecoration
record component.- Returns:
- the value of the
showDecoration
record component
-
showTooltip
public boolean showTooltip()Returns the value of theshowTooltip
record component.- Returns:
- the value of the
showTooltip
record component
-
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
public int height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-