Class RecordedEvent


  • public class RecordedEvent
    extends java.lang.Object
    Represents a previously written event.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      @NotNull java.lang.String getContentType()
      The event's content type.
      @NotNull java.time.Instant getCreated()
      When the event was created.
      byte[] getEventData()
      The event's payload data.
      <A> A getEventDataAs​(java.lang.Class<A> clazz)
      Deserialized representation of the event's payload.
      @NotNull java.util.UUID getEventId()
      The event's unique identifier.
      @NotNull java.lang.String getEventType()
      The event's type.
      @NotNull Position getPosition()
      The event's transaction log position.
      @javax.validation.constraints.NotNull long getRevision()
      The event's stream revision number.
      @NotNull java.lang.String getStreamId()
      The stream that event belongs to.
      byte[] getUserMetadata()
      The event's metadata.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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.IOException
        Deserialized 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object