Package su.onno.ui.notifications
Record Class Notification
java.lang.Object
java.lang.Record
su.onno.ui.notifications.Notification
- Record Components:
id- the notification's own id.recipientId- the target user's identity record id (therecordIdof theirCurrentUserResolver.CurrentUser), or their username for an unlinked in-memory login. This is what the delivery layer routes on.type- a short machine tag for the source (mention,assignment, …); the UI maps it to an icon and the producers set it. Never null.title- the short headline shown in the timeline row.body- optional longer text (the comment excerpt, the document number), ornull.link- thekind/name/idroute the row opens when clicked (the body of anonno://navigation url), ornullfor a non-navigating notice.actorId- the identity record id of whoever triggered it, ornull(system-raised).actorName- the actor's display name, for the row's "X assigned you …" line.actorAvatar- the actor's avatar image URL, ornull(the row falls back to initials).createdAt- when it was raised.readAt- when the recipient marked it read, ornullwhile it is still unread.
public record Notification(UUID id, String recipientId, String type, String title, String body, String link, String actorId, String actorName, String actorAvatar, Instant createdAt, Instant readAt)
extends Record
One durable, per-user notification: a timeline entry telling a person that something concerning them
happened — they were
@-mentioned in a comment, a document was assigned to them, and so on.
It is framework infrastructure, not an app-modelled entity: rows live in the framework-owned
onno_notifications table (see NotificationStore), never in the metadata model, and
never surface in the nav or the generic REST catalog API — only through /api/notifications.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactorAvatarrecord component.actorId()Returns the value of theactorIdrecord component.Returns the value of theactorNamerecord component.body()Returns the value of thebodyrecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.link()Returns the value of thelinkrecord component.readAt()Returns the value of thereadAtrecord component.Returns the value of therecipientIdrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.booleanunread()Whether the recipient has not yet marked this notification read.
-
Constructor Details
-
Notification
public Notification(UUID id, String recipientId, String type, String title, String body, String link, String actorId, String actorName, String actorAvatar, Instant createdAt, Instant readAt) Creates an instance of aNotificationrecord class.- Parameters:
id- the value for theidrecord componentrecipientId- the value for therecipientIdrecord componenttype- the value for thetyperecord componenttitle- the value for thetitlerecord componentbody- the value for thebodyrecord componentlink- the value for thelinkrecord componentactorId- the value for theactorIdrecord componentactorName- the value for theactorNamerecord componentactorAvatar- the value for theactorAvatarrecord componentcreatedAt- the value for thecreatedAtrecord componentreadAt- the value for thereadAtrecord component
-
-
Method Details
-
unread
public boolean unread()Whether the recipient has not yet marked this notification read. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
recipientId
Returns the value of therecipientIdrecord component.- Returns:
- the value of the
recipientIdrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
link
Returns the value of thelinkrecord component.- Returns:
- the value of the
linkrecord component
-
actorId
Returns the value of theactorIdrecord component.- Returns:
- the value of the
actorIdrecord component
-
actorName
Returns the value of theactorNamerecord component.- Returns:
- the value of the
actorNamerecord component
-
actorAvatar
Returns the value of theactorAvatarrecord component.- Returns:
- the value of the
actorAvatarrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
readAt
Returns the value of thereadAtrecord component.- Returns:
- the value of the
readAtrecord component
-