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/json
hash
- 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 aEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.@NotBlank String
Returns the value of thedataContentType
record component.final boolean
Indicates whether some other object is "equal to" this one.hash()
Returns the value of thehash
record component.final int
hashCode()
Returns a hash code value for this object.@NotBlank String
id()
Returns the value of theid
record component.@NotBlank String
Returns the value of thepredecessorHash
record component.@NotBlank String
source()
Returns the value of thesource
record component.@NotBlank String
Returns the value of thespecVersion
record component.@NotBlank String
subject()
Returns the value of thesubject
record component.@NotNull Instant
time()
Returns the value of thetime
record component.final String
toString()
Returns a string representation of this record class.@NotBlank String
type()
Returns the value of thetype
record 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 aEvent
record class.- Parameters:
source
- the value for thesource
record componentsubject
- the value for thesubject
record componenttype
- the value for thetype
record componentdata
- the value for thedata
record componentspecVersion
- the value for thespecVersion
record componentid
- the value for theid
record componenttime
- the value for thetime
record componentdataContentType
- the value for thedataContentType
record componenthash
- the value for thehash
record componentpredecessorHash
- the value for thepredecessorHash
record 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 thesource
record component.- Returns:
- the value of the
source
record component
-
subject
Returns the value of thesubject
record component.- Returns:
- the value of the
subject
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-
specVersion
Returns the value of thespecVersion
record component.- Returns:
- the value of the
specVersion
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
time
Returns the value of thetime
record component.- Returns:
- the value of the
time
record component
-
dataContentType
Returns the value of thedataContentType
record component.- Returns:
- the value of the
dataContentType
record component
-
hash
Returns the value of thehash
record component.- Returns:
- the value of the
hash
record component
-
predecessorHash
Returns the value of thepredecessorHash
record component.- Returns:
- the value of the
predecessorHash
record component
-