Record Class EntityMentionedEvent

java.lang.Object
java.lang.Record
su.onno.ui.comments.EntityMentionedEvent

public record EntityMentionedEvent(Comment comment, MentionRef mention, CurrentUserResolver.CurrentUser actor) extends Record
Published once for every readable entity mention in a freshly posted comment — the mention counterpart of DocumentPostedEvent. It deliberately ships with no consumers: delivery (in-app notifications, the cross-node event bus, application integrations) is purely additive and can be added later by registering a Spring @EventListener, the same decoupling the framework prescribes for posting:

 @EventListener
 void onMention(EntityMentionedEvent event) {
     // notify whoever owns event.mention(), raised by event.actor() on event.comment()
 }
 

comment is the stored comment the mention appears in, mention the resolved MentionRef (already filtered to ones the author can read), and actor the commenter.

  • Constructor Details

    • EntityMentionedEvent

      public EntityMentionedEvent(Comment comment, MentionRef mention, CurrentUserResolver.CurrentUser actor)
      Creates an instance of a EntityMentionedEvent record class.
      Parameters:
      comment - the value for the comment record component
      mention - the value for the mention record component
      actor - the value for the actor record component
  • Method Details

    • 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.
    • comment

      public Comment comment()
      Returns the value of the comment record component.
      Returns:
      the value of the comment record component
    • mention

      public MentionRef mention()
      Returns the value of the mention record component.
      Returns:
      the value of the mention record component
    • actor

      Returns the value of the actor record component.
      Returns:
      the value of the actor record component