Class ContainerItem


  • public class ContainerItem
    extends java.lang.Object
    Represents an item stored in an item container (either the inventory or Bank).
    • Constructor Summary

      Constructors 
      Constructor Description
      ContainerItem​(net.runelite.api.Item item, net.runelite.api.ItemComposition itemComposition, int slot, Context context, net.runelite.api.widgets.Widget widget, ContainerItem.ItemOrigin origin)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.awt.Rectangle getBounds​(Context context, net.runelite.api.Client client)
      Returns the rectangle bounds of an inventory item
      java.util.List<java.lang.String> getEquipmentActions()
      Gets the equipment actions, loading composition if needed.
      int getHaPrice()
      The high alchemy price for the item
      java.lang.String[] getInventoryActions()
      Gets the inventory actions, loading composition if needed.
      net.runelite.api.ItemComposition getItemComposition()
      Gets the item composition, loading it if needed.
      java.lang.String getName()
      Gets the item name, loading composition if needed.
      int hashCode()  
      boolean isFood()
      True if the item is food.
      boolean isNoted()
      Gets whether the item is noted, loading composition if needed.
      boolean isStackable()
      Gets whether the item is stackable, loading composition if needed.
      boolean isTradeable()
      Gets whether the item is tradeable, loading composition if needed.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ContainerItem

        public ContainerItem​(net.runelite.api.Item item,
                             net.runelite.api.ItemComposition itemComposition,
                             int slot,
                             Context context,
                             net.runelite.api.widgets.Widget widget,
                             ContainerItem.ItemOrigin origin)
    • Method Detail

      • getBounds

        public java.awt.Rectangle getBounds​(Context context,
                                            net.runelite.api.Client client)
        Returns the rectangle bounds of an inventory item
        Parameters:
        context - API Context
        client - RuneLite client instance
        Returns:
        Rectangle bounds for the bank item.
      • getName

        public java.lang.String getName()
        Gets the item name, loading composition if needed.
        Returns:
        String the name of the inventory item
      • isStackable

        public boolean isStackable()
        Gets whether the item is stackable, loading composition if needed.
        Returns:
        boolean true if the item is stackable and false otherwise
      • isNoted

        public boolean isNoted()
        Gets whether the item is noted, loading composition if needed.
        Returns:
        true if the item is noted and false otherwise.
      • isTradeable

        public boolean isTradeable()
        Gets whether the item is tradeable, loading composition if needed.
        Returns:
        True if the item is tradeable and false otherwise
      • getInventoryActions

        public java.lang.String[] getInventoryActions()
        Gets the inventory actions, loading composition if needed.
        Returns:
        The inventory actions for an item. i.e "Wield", "Examine", "Drop", "Use"
      • getEquipmentActions

        public java.util.List<java.lang.String> getEquipmentActions()
        Gets the equipment actions, loading composition if needed. This returns a list of actions that can be performed on the item when equipped.
        Returns:
        The list of actions on the equipment
      • getItemComposition

        public net.runelite.api.ItemComposition getItemComposition()
        Gets the item composition, loading it if needed.
        Returns:
        The items composition object
      • isFood

        public boolean isFood()
        True if the item is food. This returns jugs of wine as food and will not return rock cakes as food.
        Returns:
        True if the item is food and false otherwise.
      • getHaPrice

        public int getHaPrice()
        The high alchemy price for the item
        Returns:
        The amount of GP received when this item is high alched for gold.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object