Class Query<EntityType,​QueryType,​QR extends QueryResults>

  • Type Parameters:
    EntityType - the returned object type
    QueryType - the query type
    Direct Known Subclasses:
    InventoryItemQuery, LocatableQuery, WidgetItemQuery

    public abstract class Query<EntityType,​QueryType,​QR extends QueryResults>
    extends java.lang.Object
    A query to search the game for objects that match.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.function.Predicate<EntityType> predicate  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Query()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.function.Predicate<EntityType> and​(java.util.function.Predicate<EntityType> other)
      Constructs and returns a predicate that will evaluate predicate and the passed value.
      abstract QR result​(Client client)
      Executes the query and filters through possible objects, returning only those who evaluate true using predicate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • predicate

        protected java.util.function.Predicate<EntityType> predicate
    • Constructor Detail

      • Query

        protected Query()
    • Method Detail

      • result

        public abstract QR result​(Client client)
        Executes the query and filters through possible objects, returning only those who evaluate true using predicate.
        Parameters:
        client - the game client
        Returns:
        the matching objects
      • and

        protected java.util.function.Predicate<EntityType> and​(java.util.function.Predicate<EntityType> other)
        Constructs and returns a predicate that will evaluate predicate and the passed value.
        Parameters:
        other - the passed predicate
        Returns:
        the combined predicate