Package rs.kreme.ksbot.api.queries
Class WidgetQuery
- java.lang.Object
-
- rs.kreme.ksbot.api.queries.Query<KSWidget,WidgetQuery>
-
- rs.kreme.ksbot.api.queries.WidgetQuery
-
public class WidgetQuery extends Query<KSWidget,WidgetQuery>
A query class for filtering and retrievingWidgetobjects based on various criteria.
-
-
Constructor Summary
Constructors Constructor Description WidgetQuery(java.util.Collection<KSWidget> widgets)Constructs a WidgetQuery with the specified collection of widgets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WidgetQueryfilterUnique()Filters widgets to include only unique ones based on their item ID.KSWidgetfirst()Retrieves the first matching widget, or null if none.WidgetQueryhidden()WidgetQueryinGroup(int group)WidgetQueryqtyAbove(int value)WidgetQueryqtyBelow(int value)WidgetQueryvisible()KSWidgetwithHighestQuantity()Retrieves the widget with the highest item quantity.WidgetQuerywithIndex(int index)WidgetQuerywithoutIndex(int index)WidgetQuerywithoutPackedId(int id)WidgetQuerywithoutSprite(int sprite)WidgetQuerywithoutText(java.lang.String text)Filters out widgets by their text content using wildcard matching, with null-safety.WidgetQuerywithPackedId(int id)WidgetQuerywithParentId(int parent)WidgetQuerywithSprite(int sprite)WidgetQuerywithText(java.lang.String text)Filters widgets by their text content using wildcard matching, with null-safety.-
Methods inherited from class rs.kreme.ksbot.api.queries.Query
count, empty, exists, filter, first, last, list, list, max, min, omit, omit, omit, random, reverse, shuffledList, shuffledList, sorted, stream, unique, withId, withName, withNameOrId, withOption, withoutId, withoutName, withoutNameOrId, withoutOption
-
-
-
-
Constructor Detail
-
WidgetQuery
public WidgetQuery(java.util.Collection<KSWidget> widgets)
Constructs a WidgetQuery with the specified collection of widgets.- Parameters:
widgets- the collection of widgets to query.
-
-
Method Detail
-
withIndex
public WidgetQuery withIndex(int index)
-
withoutIndex
public WidgetQuery withoutIndex(int index)
-
withParentId
public WidgetQuery withParentId(int parent)
-
withPackedId
public WidgetQuery withPackedId(int id)
-
withoutPackedId
public WidgetQuery withoutPackedId(int id)
-
withText
public WidgetQuery withText(java.lang.String text)
Filters widgets by their text content using wildcard matching, with null-safety.
-
withoutText
public WidgetQuery withoutText(java.lang.String text)
Filters out widgets by their text content using wildcard matching, with null-safety.
-
hidden
public WidgetQuery hidden()
-
visible
public WidgetQuery visible()
-
withSprite
public WidgetQuery withSprite(int sprite)
-
withoutSprite
public WidgetQuery withoutSprite(int sprite)
-
inGroup
public WidgetQuery inGroup(int group)
-
filterUnique
public WidgetQuery filterUnique()
Filters widgets to include only unique ones based on their item ID.
-
qtyAbove
public WidgetQuery qtyAbove(int value)
-
qtyBelow
public WidgetQuery qtyBelow(int value)
-
first
public KSWidget first()
Retrieves the first matching widget, or null if none.- Overrides:
firstin classQuery<KSWidget,WidgetQuery>- Returns:
- the first matching object, or null if none exist.
-
withHighestQuantity
public KSWidget withHighestQuantity()
Retrieves the widget with the highest item quantity.
-
-