Package su.onno.ui.comments
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 Summary
ConstructorsConstructorDescriptionEntityMentionedEvent(Comment comment, MentionRef mention, CurrentUserResolver.CurrentUser actor) Creates an instance of aEntityMentionedEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionactor()Returns the value of theactorrecord component.comment()Returns the value of thecommentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mention()Returns the value of thementionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityMentionedEvent
public EntityMentionedEvent(Comment comment, MentionRef mention, CurrentUserResolver.CurrentUser actor) Creates an instance of aEntityMentionedEventrecord class.- Parameters:
comment- the value for thecommentrecord componentmention- the value for thementionrecord componentactor- the value for theactorrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
comment
Returns the value of thecommentrecord component.- Returns:
- the value of the
commentrecord component
-
mention
Returns the value of thementionrecord component.- Returns:
- the value of the
mentionrecord component
-
actor
Returns the value of theactorrecord component.- Returns:
- the value of the
actorrecord component
-