content: package com.eventsourcing.es;
  
  import lombok.AllArgsConstructor;
  import lombok.Builder;
  import lombok.Data;
  import lombok.NoArgsConstructor;
  
  import java.time.LocalDateTime;
  import java.util.UUID;
  
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  @Builder
  public class Event {
      private UUID id;
      private String aggregateId;
      private String eventType;
      private String aggregateType;
      private long version;
      private byte[] data;
      private byte[] metaData;
      private LocalDateTime timeStamp;
  
  
      public Event(String eventType, String aggregateType) {
          this.id = UUID.randomUUID();
          this.eventType = eventType;
          this.aggregateType = aggregateType;
          this.timeStamp = LocalDateTime.now();
      }
  
  
      @Override
      public String toString() {
          return "Event{" +
                  "id=" + id +
                  ", aggregateId='" + aggregateId + '\'' +
                  ", eventType='" + eventType + '\'' +
                  ", aggregateType='" + aggregateType + '\'' +
                  ", version=" + version + '\'' +
                  ", timeStamp=" + timeStamp + '\'' +
                  ", data=" + new String(data) + '\'' +
                  '}';
      }
  }