Record Class GenericTaggedEventMessage<E extends EventMessage>

java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.eventstore.GenericTaggedEventMessage<E>
Type Parameters:
E - The type of EventMessage carried by this TaggedEventMessage implementation.
Record Components:
event - The EventMessage paired with the given tags.
tags - The Set of Tags relating to the given event.
All Implemented Interfaces:
TaggedEventMessage<E>

public record GenericTaggedEventMessage<E extends EventMessage>(E extends EventMessage event, Set<Tag> tags) extends Record implements TaggedEventMessage<E>
Implementation of the TaggedEventMessage allowing a generic EventMessage of type E.
Since:
5.0.0
Author:
Steven van Beelen
  • Constructor Details

    • GenericTaggedEventMessage

      public GenericTaggedEventMessage(E event, Set<Tag> tags)
      Compact constructing asserting that the given event and tags are not null.
  • Method Details

    • updateTags

      public TaggedEventMessage<E> updateTags(Function<Set<Tag>,Set<Tag>> updater)
      Description copied from interface: TaggedEventMessage
      Construct a new TaggedEventMessage using the given updater to adjust the TaggedEventMessage.tags() of the new TaggedEventMessage.
      Specified by:
      updateTags in interface TaggedEventMessage<E extends EventMessage>
      Parameters:
      updater - The Function returning a new Set of Tags based on the existing TaggedEventMessage.tags().
      Returns:
      A new TaggedEventMessage using the given updater to adjust the TaggedEventMessage.tags() of the new TaggedEventMessage.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • event

      public E event()
      Returns the value of the event record component.
      Specified by:
      event in interface TaggedEventMessage<E extends EventMessage>
      Returns:
      the value of the event record component
    • tags

      public Set<Tag> tags()
      Returns the value of the tags record component.
      Specified by:
      tags in interface TaggedEventMessage<E extends EventMessage>
      Returns:
      the value of the tags record component