Class DepositBoxQuery
- java.lang.Object
-
- com.kraken.api.core.AbstractQuery<DepositBoxEntity,DepositBoxQuery,ContainerItem>
-
- com.kraken.api.query.container.bank.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
DepositBoxQueryis 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.
-
-
Field Summary
-
Fields inherited from class com.kraken.api.core.AbstractQuery
ctx
-
-
Constructor Summary
Constructors Constructor Description DepositBoxQuery(Context ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DepositBoxQueryall()Configures the query to look at both equipped items and wearable items in the inventory.DepositBoxQueryinEquipment()Configures the query to only look for items to deposit into the deposit box currently equipped on the player.DepositBoxQueryinInventory()Configures the query to only look for depositable items currently inside the player's inventory.DepositBoxEntityinSlot(net.runelite.api.EquipmentInventorySlot slot)Returns the interactable equipment entity for a given equipment slot.DepositBoxQuerynoted()Filters theDepositBoxQueryto include only items that are noted.DepositBoxQueryquantityGreaterThan(int amount)Filters theDepositBoxQueryto include only items with a quantity greater than the specified amount.protected java.util.function.Supplier<java.util.stream.Stream<DepositBoxEntity>>source()DepositBoxQuerystackable()Filters theDepositBoxQueryto include only items that are stackable.DepositBoxQueryunnoted()Filters theDepositBoxQueryto include only items that are unnoted.DepositBoxQuerywithId(int id)Filters for items in the deposit box that have the specified item id.-
Methods inherited from class com.kraken.api.core.AbstractQuery
count, distinct, distinctById, empty, except, filter, first, interact, interactRandom, isEmpty, list, map, nameContains, random, result, reverse, shuffle, sorted, stream, take, toRuneLite, unique, withName
-
-
-
-
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
-
source
protected java.util.function.Supplier<java.util.stream.Stream<DepositBoxEntity>> source()
- Specified by:
sourcein classAbstractQuery<DepositBoxEntity,DepositBoxQuery,ContainerItem>
-
inSlot
public DepositBoxEntity inSlot(net.runelite.api.EquipmentInventorySlot slot)
Returns the interactable equipment entity for a given equipment slot.- Parameters:
slot- TheEquipmentInventorySlotto 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
DepositBoxQueryby 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:
withIdin classAbstractQuery<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
DepositBoxQueryinstance with the specified filter applied.
-
noted
public DepositBoxQuery noted()
Filters theDepositBoxQueryto 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 theDepositBoxQueryto 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 theDepositBoxQueryto include only items that are stackable.This method refines the
DepositBoxQueryby 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 returnstrue. - If no stackable items are found, the result of this query will be empty.
- Returns:
- DepositBoxQuery A refined
DepositBoxQueryinstance that includes only the stackable items in the deposit box.
- An item is considered stackable if its
-
quantityGreaterThan
public DepositBoxQuery quantityGreaterThan(int amount)
Filters theDepositBoxQueryto include only items with a quantity greater than the specified amount.This method refines the
DepositBoxQueryby 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
amountis 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.
-
-