Class ItemQuery


  • public class ItemQuery
    extends Query<KSItem,​ItemQuery>
    A query class for filtering and retrieving KSItem objects based on various criteria. This class provides methods to filter items by properties like tradeability, price, quantity, slot, etc.
    • Constructor Detail

      • ItemQuery

        public ItemQuery​(java.util.Collection<KSItem> items)
        Constructs an ItemQuery with the specified collection of KSItem objects.
        Parameters:
        items - the collection of KSItem objects to query.
    • Method Detail

      • tradeable

        public ItemQuery tradeable()
        Filters the items to include only those that are tradeable.
        Returns:
        the current query instance containing only tradeable items.
      • differenceInValueLessThan

        public ItemQuery differenceInValueLessThan​(int difference)
        Filters items based on the difference in price (between the high alchemy price and the current price). Includes only items where the absolute price difference is less than the specified amount.
        Parameters:
        difference - the maximum allowed price difference.
        Returns:
        the current query instance with filtered items.
      • priceOver

        public ItemQuery priceOver​(int price)
        Filters items by high alchemy price, including only those with a price greater than or equal to the specified value.
        Parameters:
        price - the minimum high alchemy price.
        Returns:
        the current query instance with filtered items.
      • withSlot

        public ItemQuery withSlot​(int idx)
        Filters items by their inventory slot index. Only includes items located in the specified slot.
        Parameters:
        idx - the inventory slot index to match.
        Returns:
        the current query instance with filtered items.
      • nonPlaceHolder

        public ItemQuery nonPlaceHolder()
        Filters out placeholder items by checking their quantity. Includes items with quantity greater than 0.
        Returns:
        the current query instance with non-placeholder items.
      • quantityGreaterThan

        public ItemQuery quantityGreaterThan​(int quantity)
        Filters items based on their quantity. Only includes items with a quantity greater than the specified value.
        Parameters:
        quantity - the minimum quantity.
        Returns:
        the current query instance with filtered items.
      • onlyStackable

        public ItemQuery onlyStackable()
        Filters items to include only stackable items.
        Returns:
        the current query instance with stackable items.
      • onlyNoted

        public ItemQuery onlyNoted()
        Filters items to include only those that are noted.
        Returns:
        the current query instance with noted items.
      • onlyUnnoted

        public ItemQuery onlyUnnoted()
        Filters items to include only those that are unnoted.
        Returns:
        the current query instance with unnoted items.
      • filterContains

        public ItemQuery filterContains​(java.lang.String... substrings)
        Filters items by their name, including only those whose names contain any of the specified substrings.
        Parameters:
        substrings - the array of substrings to match within item names.
        Returns:
        the current query instance with filtered items.
      • omitContains

        public ItemQuery omitContains​(java.lang.String substring)
        Filters out items whose names contain a specific substring.
        Parameters:
        substring - the substring to exclude from item names.
        Returns:
        the current query instance with filtered items.