Class DepositBoxQuery


  • public class DepositBoxQuery
    extends AbstractQuery<DepositBoxEntity,​DepositBoxQuery,​ContainerItem>
    Represents a query system for interacting with items stored in a deposit box interface.

    This class provides functionality to filter and refine query results for items in the deposit box, which is a dedicated inventory structure for depositing items. It extends an abstract query mechanism, inheriting filtering and stream-processing capabilities.

    The DepositBoxQuery is context-aware and operates based on the current client state. It retrieves items and their corresponding details (such as noted state, stackability, and quantity) directly from the deposit box widget in the client UI.

    Supported features include:

    • Filtering items by their ID.
    • Filtering items by noted or unnoted state.
    • Filtering items by stackable properties.
    • Filtering items by quantity thresholds.

    The query operations are chainable, allowing for the combination of multiple filters. This enables flexible and precise selection of deposit box items to meet various needs.

    Thread Safety: This class interacts with client UI components and should be used in the appropriate thread context (e.g., client-side thread) to ensure proper behavior.

    • Constructor Detail

      • DepositBoxQuery

        public DepositBoxQuery​(Context ctx)
    • Method Detail

      • inInventory

        public DepositBoxQuery inInventory()
        Configures the query to only look for depositable items currently inside the player's inventory.
        Returns:
        DepositBoxQuery
      • inEquipment

        public DepositBoxQuery inEquipment()
        Configures the query to only look for items to deposit into the deposit box currently equipped on the player.
        Returns:
        DepositBoxQuery
      • all

        public DepositBoxQuery all()
        Configures the query to look at both equipped items and wearable items in the inventory.
        Returns:
        EquipmentQuery
      • inSlot

        public DepositBoxEntity inSlot​(net.runelite.api.EquipmentInventorySlot slot)
        Returns the interactable equipment entity for a given equipment slot.
        Parameters:
        slot - The EquipmentInventorySlot to retrieve.
        Returns:
        DepositBoxEntity
      • withId

        public DepositBoxQuery withId​(int id)
        Filters for items in the deposit box that have the specified item id.

        This method is used to refine the DepositBoxQuery by including only items within the deposit box that match the provided item id. It applies a filtering condition to the query and returns the updated query object.

        Overrides:
        withId in class AbstractQuery<DepositBoxEntity,​DepositBoxQuery,​ContainerItem>
        Parameters:
        id - The item id to filter for.
        • The id must represent a valid item within the deposit box.
        • If the id does not correspond to any item, the result will be an empty query.
        Returns:
        DepositBoxQuery The updated DepositBoxQuery instance with the specified filter applied.
      • noted

        public DepositBoxQuery noted()
        Filters the DepositBoxQuery to include only items that are noted.

        An item is considered "noted" if it is a placeholder or tradeable voucher referring to a stackable quantity of the item rather than the physical item itself. This method relies on the isNoted() method of the underlying item's composition to determine its noted state.

        Returns:
        DepositBoxQuery A refined query instance including only the items from the deposit box that are in a noted state.
      • unnoted

        public DepositBoxQuery unnoted()
        Filters the DepositBoxQuery to include only items that are unnoted.

        An item is considered "unnoted" if it is the actual physical item rather than a placeholder or tradeable voucher for a stackable quantity. This method relies on the isNoted() method of the raw item to determine its state, and excludes items that are noted.

        Returns:
        DepositBoxQuery A refined query instance including only the items from the deposit box that are in an unnoted state.
      • stackable

        public DepositBoxQuery stackable()
        Filters the DepositBoxQuery to include only items that are stackable.

        This method refines the DepositBoxQuery by applying a filtering condition that selects items from the deposit box which are deemed stackable. Stackable items allow multiple units to occupy a single inventory slot.

        • An item is considered stackable if its isStackable() method returns true.
        • If no stackable items are found, the result of this query will be empty.
        Returns:
        DepositBoxQuery A refined DepositBoxQuery instance that includes only the stackable items in the deposit box.
      • quantityGreaterThan

        public DepositBoxQuery quantityGreaterThan​(int amount)
        Filters the DepositBoxQuery to include only items with a quantity greater than the specified amount.

        This method refines the DepositBoxQuery by applying a filtering condition that selects items from the deposit box where their quantity exceeds the given value. The resulting query will only include items meeting this criteria.

        • If no items in the deposit box have a quantity greater than the provided amount, the query result will be empty.
        Parameters:
        amount - The minimum quantity threshold for filtering items.
        • Must be a non-negative integer.
        • If amount is zero, all items with a positive quantity will be included in the result.
        Returns:
        DepositBoxQuery An updated query instance including only items whose quantity exceeds the specified amount.