Package io.umadb.client
Record Class QueryItem
java.lang.Object
java.lang.Record
io.umadb.client.QueryItem
- Record Components:
types- a non-null list of event types; may be empty- a non-null list of tags; may be empty
Defines a single criterion for matching events.
A QueryItem matches an event if:
- at least one of its
typesmatches the event type, ortypesis empty; and - all of its
tagsmatch one of the event tags, ortagsis empty.
Semantics:
typesrepresents a logical OR across event typestagsrepresents a logical AND across event tags
QueryItems are combined in a Query to define
which events should be selected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static QueryItemmatchAll()Creates aQueryItemthat matches all events.static QueryItemCreates aQueryItemthat matches events that have any of the given types and containing all the given tags.static QueryItemCreates aQueryItemthat matches events containing all the given tags.static QueryItemCreates aQueryItemthat matches events of the given types.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.types()Returns the value of thetypesrecord component.
-
Constructor Details
-
QueryItem
Creates a newQueryItem.- Throws:
IllegalArgumentException- iftypesortagsisnull
-
-
Method Details
-
matchAll
Creates aQueryItemthat matches all events.- Returns:
- a
QueryItemwith no type or tag constraints
-
ofTypes
Creates aQueryItemthat matches events of the given types.- Parameters:
types- the event types to match (logical OR)- Returns:
- a
QueryItemwith the given type constraints - Throws:
IllegalArgumentException- iftypesisnull
-
ofTags
Creates aQueryItemthat matches events containing all the given tags.- Parameters:
tags- the tags to match (logical AND)- Returns:
- a
QueryItemwith the given tag constraints - Throws:
IllegalArgumentException- iftagsisnull
-
of
Creates aQueryItemthat matches events that have any of the given types and containing all the given tags.- Parameters:
types- the event types to match (logical OR)tags- the tags to match (logical AND)- Returns:
- a
QueryItemwith both type and tag constraints - Throws:
IllegalArgumentException- iftypesortagsisnull
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-