Class ItemInfo

java.lang.Object
jadex.bdi.shop.ItemInfo

public class ItemInfo extends Object
Item info stores details about items. Note: two item infos are considered equal if there name is equal. This allows fetching old item infos and updating them by item name.
  • Field Details

    • name

      protected String name
      The name .
    • price

      protected double price
      The price.
    • quantity

      protected int quantity
      The quantity.
  • Constructor Details

    • ItemInfo

      public ItemInfo()
      Create a new item info.
    • ItemInfo

      public ItemInfo(String name)
      Create a new item info.
    • ItemInfo

      public ItemInfo(String name, double price, int quantity)
      Create a new item info.
  • Method Details

    • getName

      public String getName()
      Get the name.
      Returns:
      the name.
    • setName

      public void setName(String name)
      Set the name.
      Parameters:
      name - The name to set.
    • getPrice

      public double getPrice()
      Get the price.
      Returns:
      the price.
    • setPrice

      public void setPrice(double price)
      Set the price.
      Parameters:
      price - The price to set.
    • getQuantity

      public int getQuantity()
      Get the quantity.
      Returns:
      The quantity.
    • setQuantity

      public void setQuantity(int quantity)
      Set the quantity.
      Parameters:
      quantity - The quantity to set.
    • hashCode

      public int hashCode()
      Get the hashcode.
      Overrides:
      hashCode in class Object
      Returns:
      The hashcode.
    • equals

      public boolean equals(Object obj)
      Test if an object is equal to this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to test.
      Returns:
      True, if both are equal.