diff --git a/iutils/src/main/java/net/runelite/client/plugins/iutils/ui/EquipmentItemStream.java b/iutils/src/main/java/net/runelite/client/plugins/iutils/ui/EquipmentItemStream.java index 5ee0f7ab..665828d3 100644 --- a/iutils/src/main/java/net/runelite/client/plugins/iutils/ui/EquipmentItemStream.java +++ b/iutils/src/main/java/net/runelite/client/plugins/iutils/ui/EquipmentItemStream.java @@ -18,14 +18,35 @@ public class EquipmentItemStream extends RandomizedStreamAdapter Arrays.stream(ids).anyMatch(id -> o.id() == id)); } + /** + * Returns a stream consisting of the elements of this stream with + * any of the given {@link InventoryItem#id()}s + */ + public EquipmentItemStream withId(Collection ids) { + return filter(o -> ids.stream().anyMatch(id -> o.id() == id)); + } + /** + * Returns a stream consisting of the elements of this stream that don't match + * any of the given {@link InventoryItem#id()}s + */ + public EquipmentItemStream withoutId(Collection ids) { + return filter(o -> ids.stream().noneMatch(id -> o.id() == id)); + } + /** + * Returns a stream consisting of the elements of this stream that don't match + * any of the given {@link InventoryItem#id()}s + */ + public EquipmentItemStream withoutId(int... ids) { + return filter(o -> Arrays.stream(ids).noneMatch(id -> o.id() == id)); + } /** * Returns a stream consisting of the elements of this stream with * a minimum {@link EquipmentItem#quantity()} @@ -49,6 +70,13 @@ public class EquipmentItemStream extends RandomizedStreamAdapter Arrays.stream(names).anyMatch(name -> o.name().toLowerCase().contains(name.toLowerCase()))); } + /** + * Returns a stream consisting of the elements of this stream that don't match + * any of the given {@link InventoryItem#name()}s + */ + public EquipmentItemStream withoutNamePart(String... names) { + return filter(o -> Arrays.stream(names).noneMatch(name -> o.name().toLowerCase().contains(name.toLowerCase()))); + } /** * Returns a stream consisting of the elements of this stream with