Package io.umadb.client
Record Class AppendCondition
java.lang.Object
java.lang.Record
io.umadb.client.AppendCondition
- Record Components:
failIfEventsMatch- a non-null query defining events that must not already exist for the append operation to succeedafter- an optional position after which the condition applies; may benullto indicate no lower bound
Represents a conditional constraint applied when appending events.
The append operation will fail if events matching the provided failIfEventsMatch
query already exist. Optionally, the condition can be further constrained to only
consider events occurring after a given position.
-
Constructor Summary
ConstructorsConstructorDescriptionAppendCondition(Query failIfEventsMatch, Long after) Creates a newAppendCondition. -
Method Summary
Modifier and TypeMethodDescriptionafter()Returns the value of theafterrecord component.after(long after) Returns a copy of this condition that applies only to events occurring after the specified position or timestamp.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailIfEventsMatchrecord component.static AppendConditionfailIfExists(Query query) Creates anAppendConditionthat fails the append operation if any events matching the given query already exist.static AppendConditionfailIfExistsAfter(Query query, long after) Creates anAppendConditionthat fails the append operation if events matching the given query exist after the specified position.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AppendCondition
Creates a newAppendCondition.- Throws:
IllegalArgumentException- iffailIfEventsMatchisnull
-
-
Method Details
-
failIfExists
Creates anAppendConditionthat fails the append operation if any events matching the given query already exist.- Parameters:
query- the query defining events that must not exist- Returns:
- a new
AppendCondition - Throws:
IllegalArgumentException- ifqueryisnull
-
failIfExistsAfter
Creates anAppendConditionthat fails the append operation if events matching the given query exist after the specified position.- Parameters:
query- the query defining events that must not existafter- the lower bound (position or timestamp) after which matching events are considered- Returns:
- a new
AppendCondition - Throws:
IllegalArgumentException- ifqueryisnull
-
after
Returns a copy of this condition that applies only to events occurring after the specified position or timestamp.This method is useful for fluently refining an existing condition.
- Parameters:
after- the lower bound (position or timestamp)- Returns:
- a new
AppendConditionwith the updatedaftervalue
-
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). -
failIfEventsMatch
Returns the value of thefailIfEventsMatchrecord component.- Returns:
- the value of the
failIfEventsMatchrecord component
-
after
Returns the value of theafterrecord component.- Returns:
- the value of the
afterrecord component
-