Record Class Precondition.SubjectIsOnEventId

java.lang.Object
java.lang.Record
com.opencqrs.esdb.client.Precondition.SubjectIsOnEventId
Record Components:
subject - the path to the subject
eventId - the expected event id
All Implemented Interfaces:
Precondition
Enclosing interface:
Precondition

public static record Precondition.SubjectIsOnEventId(@NotBlank String subject, @NotBlank String eventId) extends Record implements Precondition
A precondition stating the given subject must have been updated by the given event id. The precondition is violated if either the subject does not exist at all or an event with another id has already been published for that subject.
  • Constructor Details

    • SubjectIsOnEventId

      public SubjectIsOnEventId(@NotBlank @NotBlank String subject, @NotBlank @NotBlank String eventId)
      Creates an instance of a SubjectIsOnEventId record class.
      Parameters:
      subject - the value for the subject record component
      eventId - the value for the eventId record component
  • Method Details

    • 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.
    • subject

      @NotBlank public @NotBlank String subject()
      Returns the value of the subject record component.
      Returns:
      the value of the subject record component
    • eventId

      @NotBlank public @NotBlank String eventId()
      Returns the value of the eventId record component.
      Returns:
      the value of the eventId record component