Record Class TradeListPacket.ItemCost
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket.ItemCost
- Enclosing class:
TradeListPacket
public static record TradeListPacket.ItemCost(@NotNull Material material, int amount, @NotNull DataComponentMap components)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionItemCost(@NotNull Material material, int amount, @NotNull DataComponentMap components) Creates an instance of aItemCostrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintamount()Returns the value of theamountrecord component.@NotNull DataComponentMapReturns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Materialmaterial()Returns the value of thematerialrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemCost
-
ItemCost
public ItemCost(@NotNull @NotNull Material material, int amount, @NotNull @NotNull DataComponentMap components) Creates an instance of aItemCostrecord class.- Parameters:
material- the value for thematerialrecord componentamount- the value for theamountrecord componentcomponents- the value for thecomponentsrecord component
-
-
Method Details
-
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 '=='. -
material
Returns the value of thematerialrecord component.- Returns:
- the value of the
materialrecord component
-
amount
public int amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-