Record Class EventCandidate

java.lang.Object
java.lang.Record
com.opencqrs.esdb.client.EventCandidate
Record Components:
source - identifies the originating source of publication
subject - an absolute path identifying the subject that the event is related to
type - uniquely identifies the event type, specifically for being able to interpret the contained data structure
data - a generic map structure containing the event payload, which is going to be stored as JSON within the event store

public record EventCandidate(@NotBlank String source, @NotBlank String subject, @NotBlank String type, @NotNull Map<String,?> data) extends Record
Candidate event for publication to a Cloud Events Specification conforming event store.
See Also:
  • Constructor Details

    • EventCandidate

      public EventCandidate(@NotBlank @NotBlank String source, @NotBlank @NotBlank String subject, @NotBlank @NotBlank String type, @NotNull @NotNull Map<String,?> data)
      Creates an instance of a EventCandidate record class.
      Parameters:
      source - the value for the source record component
      subject - the value for the subject record component
      type - the value for the type record component
      data - the value for the data 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.
    • source

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

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

      @NotBlank public @NotBlank String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • data

      @NotNull public @NotNull Map<String,?> data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component