Package com.eventstore.dbclient
Class RecordedEvent
- java.lang.Object
-
- com.eventstore.dbclient.RecordedEvent
-
public class RecordedEvent extends java.lang.ObjectRepresents a previously written event.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)@NotNull java.lang.StringgetContentType()The event's content type.@NotNull java.time.InstantgetCreated()When the event was created.byte[]getEventData()The event's payload data.<A> AgetEventDataAs(java.lang.Class<A> clazz)Deserialized representation of the event's payload.@NotNull java.util.UUIDgetEventId()The event's unique identifier.@NotNull java.lang.StringgetEventType()The event's type.@NotNull PositiongetPosition()The event's transaction log position.@javax.validation.constraints.NotNull longgetRevision()The event's stream revision number.@NotNull java.lang.StringgetStreamId()The stream that event belongs to.byte[]getUserMetadata()The event's metadata.inthashCode()
-
-
-
Method Detail
-
getStreamId
@NotNull public @NotNull java.lang.String getStreamId()
The stream that event belongs to.
-
getRevision
@NotNull public @javax.validation.constraints.NotNull long getRevision()
The event's stream revision number.
-
getEventId
@NotNull public @NotNull java.util.UUID getEventId()
The event's unique identifier.
-
getEventType
@NotNull public @NotNull java.lang.String getEventType()
The event's type.
-
getEventData
public byte[] getEventData()
The event's payload data.
-
getEventDataAs
public <A> A getEventDataAs(java.lang.Class<A> clazz) throws java.io.IOExceptionDeserialized representation of the event's payload. In this case, the payload is supposed to be JSON.- Throws:
java.io.IOException
-
getUserMetadata
public byte[] getUserMetadata()
The event's metadata.
-
getCreated
@NotNull public @NotNull java.time.Instant getCreated()
When the event was created.
-
getPosition
@NotNull public @NotNull Position getPosition()
The event's transaction log position.
-
getContentType
@NotNull public @NotNull java.lang.String getContentType()
The event's content type. Could be application/json or application/octet-stream.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-