Record Class AppendRequest
java.lang.Object
java.lang.Record
io.umadb.client.AppendRequest
- Record Components:
events- the non-null, non-empty list of events to appendcondition- an optionalAppendConditionthat must be satisfied for the append operation to succeed; may benulltrackingInfo- optional checkpointing information advancing the source's tracking cursor when the append succeeds; may benull
public record AppendRequest(List<Event> events, AppendCondition condition, TrackingInfo trackingInfo)
extends Record
Represents a request to append one or more events.
-
Constructor Summary
ConstructorsConstructorDescriptionAppendRequest(List<Event> events, AppendCondition condition) Creates anAppendRequestwithout tracking info.AppendRequest(List<Event> events, AppendCondition condition, TrackingInfo trackingInfo) Creates a newAppendRequest. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.events()Returns the value of theeventsrecord component.final inthashCode()Returns a hash code value for this object.static AppendRequestCreates anAppendRequestwithout any append condition.static AppendRequestof(List<Event> events, AppendCondition condition) Creates anAppendRequestwith the given append condition.final StringtoString()Returns a string representation of this record class.Returns the value of thetrackingInforecord component.withCondition(AppendCondition condition) Returns a copy of this request with the given append condition applied.withTrackingInfo(TrackingInfo trackingInfo) Returns a copy of this request that also advances the given tracking cursor when the append succeeds.
-
Constructor Details
-
AppendRequest
Creates a newAppendRequest.- Throws:
IllegalArgumentException- ifeventsisnullor empty
-
AppendRequest
Creates anAppendRequestwithout tracking info.- Parameters:
events- the events to appendcondition- the append condition to apply; may benull- Throws:
IllegalArgumentException- ifeventsisnullor empty
-
-
Method Details
-
of
Creates anAppendRequestwithout any append condition.- Parameters:
events- the events to append- Returns:
- a new
AppendRequest - Throws:
IllegalArgumentException- ifeventsisnullor empty
-
of
Creates anAppendRequestwith the given append condition.- Parameters:
events- the events to appendcondition- the append condition to apply- Returns:
- a new
AppendRequest - Throws:
IllegalArgumentException- ifeventsisnullor empty
-
withCondition
Returns a copy of this request with the given append condition applied.- Parameters:
condition- the append condition to apply- Returns:
- a new
AppendRequestwith the specified condition
-
withTrackingInfo
Returns a copy of this request that also advances the given tracking cursor when the append succeeds.- Parameters:
trackingInfo- the tracking info to checkpoint; may benull- Returns:
- a new
AppendRequestwith the specified tracking info
-
toString
-
hashCode
-
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). -
events
-
condition
-
trackingInfo
Returns the value of thetrackingInforecord component.- Returns:
- the value of the
trackingInforecord component
-