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 (the recordId of their CurrentUserResolver.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), or null.
link - the kind/name/id route the row opens when clicked (the body of an onno:// navigation url), or null for a non-navigating notice.
actorId - the identity record id of whoever triggered it, or null (system-raised).
actorName - the actor's display name, for the row's "X assigned you …" line.
actorAvatar - the actor's avatar image URL, or null (the row falls back to initials).
createdAt - when it was raised.
readAt - when the recipient marked it read, or null while 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 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 a Notification record class.
      Parameters:
      id - the value for the id record component
      recipientId - the value for the recipientId record component
      type - the value for the type record component
      title - the value for the title record component
      body - the value for the body record component
      link - the value for the link record component
      actorId - the value for the actorId record component
      actorName - the value for the actorName record component
      actorAvatar - the value for the actorAvatar record component
      createdAt - the value for the createdAt record component
      readAt - the value for the readAt record component
  • Method Details

    • unread

      public boolean unread()
      Whether the recipient has not yet marked this notification read.
    • 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.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • recipientId

      public String recipientId()
      Returns the value of the recipientId record component.
      Returns:
      the value of the recipientId record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • body

      public String body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • link

      public String link()
      Returns the value of the link record component.
      Returns:
      the value of the link record component
    • actorId

      public String actorId()
      Returns the value of the actorId record component.
      Returns:
      the value of the actorId record component
    • actorName

      public String actorName()
      Returns the value of the actorName record component.
      Returns:
      the value of the actorName record component
    • actorAvatar

      public String actorAvatar()
      Returns the value of the actorAvatar record component.
      Returns:
      the value of the actorAvatar record component
    • createdAt

      public Instant createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • readAt

      public Instant readAt()
      Returns the value of the readAt record component.
      Returns:
      the value of the readAt record component