Class ItemQuery
This class provides comprehensive filtering capabilities for items:
- Filter by item IDs
- Filter by noted item IDs
- Filter by inventory slots
- Filter by item names
- Filter by available actions
- Filter by tradability
- Filter by stackability
- Filter by members-only status
- Filter by noted status
Example usage:
// Find all tradable food items in inventory
ItemQuery query = new ItemQuery(inventorySupplier)
.actions("Eat")
.tradable(true);
ItemQueryResults results = query.results();
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFilters items by their available actions.ids(int... ids) Filters items by their IDs.members(boolean members) Filters items by their members-only status.Filters items by their names using exact matching.noted(boolean noted) Filters items by their noted status.notedIds(int... notedIds) Filters items by their noted IDs.protected ItemQueryResultsWraps the filtered list of items in an ItemQueryResults container.slots(int... slots) Filters items by their inventory slot positions.stackable(boolean stackable) Filters items by their stackability.booleanTests whether an item passes all accumulated filter criteria.tradable(boolean tradable) Filters items by their tradability.
-
Constructor Details
-
ItemQuery
Constructs a new item query with the specified item supplier.- Parameters:
supplier- a supplier that provides the list of items to query
-
-
Method Details
-
ids
Filters items by their IDs.Only items with an ID matching one of the specified values will be included.
- Parameters:
ids- the item IDs to filter by- Returns:
- this query instance for method chaining
-
notedIds
Filters items by their noted IDs.Only items with a noted ID matching one of the specified values will be included.
- Parameters:
notedIds- the noted item IDs to filter by- Returns:
- this query instance for method chaining
-
slots
Filters items by their inventory slot positions.Only items located in one of the specified slots will be included.
- Parameters:
slots- the slot positions to filter by- Returns:
- this query instance for method chaining
-
names
Filters items by their names using exact matching.Only items whose name exactly matches one of the specified values will be included.
- Parameters:
names- the item names to filter by- Returns:
- this query instance for method chaining
-
actions
Filters items by their available actions.Only items that have at least one action matching one of the specified values will be included.
- Parameters:
actions- the actions to filter by- Returns:
- this query instance for method chaining
-
tradable
Filters items by their tradability.Only items whose tradability matches the specified value will be included.
- Parameters:
tradable-trueto include only tradable items,falsefor untradable items- Returns:
- this query instance for method chaining
-
stackable
Filters items by their stackability.Only items whose stackability matches the specified value will be included.
- Parameters:
stackable-trueto include only stackable items,falsefor non-stackable items- Returns:
- this query instance for method chaining
-
members
Filters items by their members-only status.Only items whose members status matches the specified value will be included.
- Parameters:
members-trueto include only members items,falsefor free-to-play items- Returns:
- this query instance for method chaining
-
noted
Filters items by their noted status.Only items whose noted status matches the specified value will be included.
- Parameters:
noted-trueto include only noted items,falsefor unnoted items- Returns:
- this query instance for method chaining
-
results
Wraps the filtered list of items in an ItemQueryResults container.- Specified by:
resultsin classQuery<IItem,ItemQuery, ItemQueryResults> - Parameters:
list- the list of items that passed all filters- Returns:
- the results wrapped in an ItemQueryResults container
-
test
Tests whether an item passes all accumulated filter criteria.This method checks the item against all configured filters including ID, noted ID, slot, name, actions, tradability, stackability, members status, and noted status.
-