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 append
condition - an optional AppendCondition that must be satisfied for the append operation to succeed; may be null

public record AppendRequest(List<Event> events, AppendCondition condition) extends Record
Represents a request to append one or more events.
  • Constructor Details

  • Method Details

    • of

      public static AppendRequest of(List<Event> events)
      Creates an AppendRequest without any append condition.
      Parameters:
      events - the events to append
      Returns:
      a new AppendRequest
      Throws:
      IllegalArgumentException - if events is null or empty
    • of

      public static AppendRequest of(List<Event> events, AppendCondition condition)
      Creates an AppendRequest with the given append condition.
      Parameters:
      events - the events to append
      condition - the append condition to apply
      Returns:
      a new AppendRequest
      Throws:
      IllegalArgumentException - if events is null or empty
    • withCondition

      public AppendRequest withCondition(AppendCondition condition)
      Returns a copy of this request with the given append condition applied.
      Parameters:
      condition - the append condition to apply
      Returns:
      a new AppendRequest with the specified condition
    • 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.
    • events

      public List<Event> events()
      Returns the value of the events record component.
      Returns:
      the value of the events record component
    • condition

      public AppendCondition condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component