Package com.opencqrs.esdb.client
Record Class Event
java.lang.Object
java.lang.Record
com.opencqrs.esdb.client.Event
- Record Components:
source- identifies the originating source of publicationsubject- an absolute path identifying the subject that the event is related totype- uniquely identifies the event type, specifically for being able to interpret the contained data structuredata- a generic map structure containing the event payloadspecVersion- cloud events specification versionid- a unique event identifier with respect to the originating event storetime- the publication time-stampdataContentType- the data content-type, alwaysapplication/jsonhash- the hash of this eventpredecessorHash- the hash of the preceding event in the event store
- All Implemented Interfaces:
Marshaller.ResponseElement
public record Event(@NotBlank String source, @NotBlank String subject, @NotBlank String type, @NotNull Map<String,?> data, @NotBlank String specVersion, @NotBlank String id, @NotNull Instant time, @NotBlank String dataContentType, String hash, @NotBlank String predecessorHash)
extends Record
implements Marshaller.ResponseElement
Event data structure retrieved from an event store, conforming to the Cloud Events Specification.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.opencqrs.esdb.client.Marshaller.ResponseElement
Marshaller.ResponseElement.Heartbeat -
Constructor Summary
ConstructorsConstructorDescriptionEvent(@NotBlank String source, @NotBlank String subject, @NotBlank String type, @NotNull Map<String, ?> data, @NotBlank String specVersion, @NotBlank String id, @NotNull Instant time, @NotBlank String dataContentType, String hash, @NotBlank String predecessorHash) Creates an instance of aEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.@NotBlank StringReturns the value of thedataContentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.hash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.@NotBlank Stringid()Returns the value of theidrecord component.@NotBlank StringReturns the value of thepredecessorHashrecord component.@NotBlank Stringsource()Returns the value of thesourcerecord component.@NotBlank StringReturns the value of thespecVersionrecord component.@NotBlank Stringsubject()Returns the value of thesubjectrecord component.@NotNull Instanttime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.@NotBlank Stringtype()Returns the value of thetyperecord component.
-
Constructor Details
-
Event
public Event(@NotBlank @NotBlank String source, @NotBlank @NotBlank String subject, @NotBlank @NotBlank String type, @NotNull @NotNull Map<String, ?> data, @NotBlank @NotBlank String specVersion, @NotBlank @NotBlank String id, @NotNull @NotNull Instant time, @NotBlank @NotBlank String dataContentType, String hash, @NotBlank @NotBlank String predecessorHash) Creates an instance of aEventrecord class.- Parameters:
source- the value for thesourcerecord componentsubject- the value for thesubjectrecord componenttype- the value for thetyperecord componentdata- the value for thedatarecord componentspecVersion- the value for thespecVersionrecord componentid- the value for theidrecord componenttime- the value for thetimerecord componentdataContentType- the value for thedataContentTyperecord componenthash- the value for thehashrecord componentpredecessorHash- the value for thepredecessorHashrecord component
-
-
Method Details
-
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). -
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
specVersion
Returns the value of thespecVersionrecord component.- Returns:
- the value of the
specVersionrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
time
Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
dataContentType
Returns the value of thedataContentTyperecord component.- Returns:
- the value of the
dataContentTyperecord component
-
hash
Returns the value of thehashrecord component.- Returns:
- the value of the
hashrecord component
-
predecessorHash
Returns the value of thepredecessorHashrecord component.- Returns:
- the value of the
predecessorHashrecord component
-