Record Class TradeListPacket.Trade

java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TradeListPacket.Trade
Enclosing class:
TradeListPacket

public static record TradeListPacket.Trade(@NotNull TradeListPacket.ItemCost inputItem1, @NotNull ItemStack result, @Nullable TradeListPacket.ItemCost inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Trade(@NotNull ItemStack inputItem1, @NotNull ItemStack result, @Nullable ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
     
    Trade(@NotNull TradeListPacket.ItemCost inputItem1, @NotNull ItemStack result, @Nullable TradeListPacket.ItemCost inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
    Creates an instance of a Trade record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the demand record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    exp()
    Returns the value of the exp record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the inputItem1 record component.
    Returns the value of the inputItem2 record component.
    int
    Returns the value of the maxTradeUsesNumber record component.
    float
    Returns the value of the priceMultiplier record component.
    @NotNull ItemStack
    Returns the value of the result record component.
    int
    Returns the value of the specialPrice record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the tradeDisabled record component.
    int
    Returns the value of the tradeUsesNumber record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Trade

      public Trade(@NotNull @NotNull ItemStack inputItem1, @NotNull @NotNull ItemStack result, @Nullable @Nullable ItemStack inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
    • Trade

      public Trade(@NotNull @NotNull TradeListPacket.ItemCost inputItem1, @NotNull @NotNull ItemStack result, @Nullable @Nullable TradeListPacket.ItemCost inputItem2, boolean tradeDisabled, int tradeUsesNumber, int maxTradeUsesNumber, int exp, int specialPrice, float priceMultiplier, int demand)
      Creates an instance of a Trade record class.
      Parameters:
      inputItem1 - the value for the inputItem1 record component
      result - the value for the result record component
      inputItem2 - the value for the inputItem2 record component
      tradeDisabled - the value for the tradeDisabled record component
      tradeUsesNumber - the value for the tradeUsesNumber record component
      maxTradeUsesNumber - the value for the maxTradeUsesNumber record component
      exp - the value for the exp record component
      specialPrice - the value for the specialPrice record component
      priceMultiplier - the value for the priceMultiplier record component
      demand - the value for the demand record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • inputItem1

      @NotNull public @NotNull TradeListPacket.ItemCost inputItem1()
      Returns the value of the inputItem1 record component.
      Returns:
      the value of the inputItem1 record component
    • result

      @NotNull public @NotNull ItemStack result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • inputItem2

      @Nullable public @Nullable TradeListPacket.ItemCost inputItem2()
      Returns the value of the inputItem2 record component.
      Returns:
      the value of the inputItem2 record component
    • tradeDisabled

      public boolean tradeDisabled()
      Returns the value of the tradeDisabled record component.
      Returns:
      the value of the tradeDisabled record component
    • tradeUsesNumber

      public int tradeUsesNumber()
      Returns the value of the tradeUsesNumber record component.
      Returns:
      the value of the tradeUsesNumber record component
    • maxTradeUsesNumber

      public int maxTradeUsesNumber()
      Returns the value of the maxTradeUsesNumber record component.
      Returns:
      the value of the maxTradeUsesNumber record component
    • exp

      public int exp()
      Returns the value of the exp record component.
      Returns:
      the value of the exp record component
    • specialPrice

      public int specialPrice()
      Returns the value of the specialPrice record component.
      Returns:
      the value of the specialPrice record component
    • priceMultiplier

      public float priceMultiplier()
      Returns the value of the priceMultiplier record component.
      Returns:
      the value of the priceMultiplier record component
    • demand

      public int demand()
      Returns the value of the demand record component.
      Returns:
      the value of the demand record component