Record Class Query

java.lang.Object
java.lang.Record
io.umadb.client.Query
Record Components:
items - a non-null list of query items; may be empty

public record Query(List<QueryItem> items) extends Record
Represents a query composed of zero or more QueryItems.

A Query is used to describe conditions for selecting or matching events. An empty query matches all events.

  • Constructor Details

  • Method Details

    • empty

      public static Query empty()
      Creates an empty Query that matches all events.
      Returns:
      an empty Query
    • of

      public static Query of(QueryItem item)
      Creates a Query containing a single query item.
      Parameters:
      item - the query item
      Returns:
      a Query containing the given item
      Throws:
      IllegalArgumentException - if item is null
    • of

      public static Query of(List<QueryItem> items)
      Creates a Query containing the given query items.
      Parameters:
      items - the query items
      Returns:
      a Query containing the given items
      Throws:
      IllegalArgumentException - if items is null
    • and

      public Query and(QueryItem item)
      Returns a new Query with the given item appended.
      Parameters:
      item - the query item to add
      Returns:
      a new Query including the given item
      Throws:
      IllegalArgumentException - if item is null
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • items

      public List<QueryItem> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component